+sub DESTROY {
+ my $self = shift;
+ return unless $self->{pid} eq $$;
+ if ( driver_name() eq 'Pg' ) {
+ $self->{dbh}->do('CLOSE '. $self->{id})
+ or die $self->{dbh}->errstr; # clean-up the cursor in Pg
+ } elsif ( driver_name() eq 'mysql' ) {
+ # nothing; the temporary table will evaporate when the
+ # session closes.
+ }
+ $self->{dbh}->rollback;
+ $self->{dbh}->disconnect;
+}
+