Re: undefined behaviour for sub-transactions?
Tyler MacDonald <[email protected]>
| Newsgroups | gmane.comp.db.mysql.perl |
|---|---|
| Message-ID | <20051115074142.GG23215__39304.1382929825$1132040606$gmane$org@yi.org> |
Jochen Wiedmann <[email protected]> wrote: > > Is there a way to ask DBI if it is already in a transaction? > Read the AutCommit flag. :-) It says, Enable transactions (by turning "AutoCommit" off) until the next call to "commit" or "rollback". After the next "commit" or "roll- back", "AutoCommit" will automatically be turned on again. If "AutoCommit" is already off when "begin_work" is called then it does nothing except return an error. If the driver does not support transactions then when "begin_work" attempts to set "AutoCommit" off the driver will trigger a fatal error. However, when using the DBD::Pg driver, begin_work only triggers an error if the driver was *initialized* with AutoCommit off, and if you begin_work with AutoCommit on, the next query to $dbh->{AutoCommit} still returns true, and transactions nest successfully. So is the DBD::Pg driver in error then? (In other words, there's no support for nested transactions in DBI at all?) - Tyler -- MySQL Perl Mailing List For list archives: http://lists.mysql.com/perl To unsubscribe: http://lists.mysql.com/[email protected]