-----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160
> This area is already inconsistent. From DBI under disconnect: > > "The transaction behaviour of the disconnect method is, sadly, > undefined. Some database systems (such as Oracle and Ingres) > will automatically commit any outstanding changes, Aside: COMMIT is an insane default. :) > but others (such as Informix) will rollback any outstanding changes." Right, I'm not saying the rollback or commit can be standardized, I'm saying we need to standardize on whether we throw a warning or not. Right now DBI does *not* give any warnings, and I presume this was done on purpose. But see below... > I'm not sure how we'd get DBI to control this I don't think it knows > - all it does on DESTROY right now is to call rollback if disconnect > has not been called. However, DBD::ODBC knows when disconnect is > called and it calls SQLDisconnect which errors with state 25000 > that a txn was in progress. Right, it's completely up to the drivers to control the behavior, but DBI can certainly handle the warning/notification: maybe something generic enough that could be overriden by a driver? Maybe that's why nothing was ever printed, as it would be "Disconnect called with an open transaction, so we committed it OR rolled it back (consult your DBD docs)". Hmmm...I wonder if rather than overriding the message, the driver could provide some sort of method such that DBI knows the commit/rollback behavior. Which could in theory be useful in other places. > DBI also says > "Generally, if you want your changes to be committed or rolled > back when you disconnect, then you should explicitly call > "commit" or "rollback" before disconnecting." > > I'm still of the feeling that calling disconnect without > committing or rolling back is probably a mistake (and almost > definitely a mistake if your code could use multiple DBDs). With multiple, yes, but with a single one that does something sane (in other words, a rollback) I think it's a valid "shortcut". But I would certainly be okay with adding a warning. - -- Greg Sabino Mullane g...@turnstep.com End Point Corporation http://www.endpoint.com/ PGP Key: 0x14964AC8 201103162039 http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8 -----BEGIN PGP SIGNATURE----- iEYEAREDAAYFAk2BWHoACgkQvJuQZxSWSsjC8gCgu9YVyeCH6K2I3VkS09KMilFE qHMAniearHW1omu0aA2ZPmLasklFNPiT =ftn+ -----END PGP SIGNATURE-----