Re: perl DBI "with hold" better workaround?
Posted in 1999
zwdeja@my-deja.com wrote: > The only workaround I could come up with for the lack of "with hold" > in perl DBI is to run my transaction stuff on a different connection > than my select stuff. > > Any others? Open the connection with { AutoCommit => 1 } gives you hold cursors. On the other hand, it does not give you transactions in any meaningful sense of the term. You can do a BEGIN WORK, of course, but the transaction is automatically committed. You can do ROLLBACK WORK, but the newly created transaction is rolled back, achieving nothing. Yuck! AutoCommit is the biggest plague of my life. It is also likely to the reason for a schism between DBI/DBD::Informix and some other Perl package to handle Informix more comfortably for Informix users. I might get around to adding an Informix-specific attribute to the $sth->prepare or $sth->execute methods (and one design issue is which should it be!) to handle WITH HOLD cursors. I was hoping to piggy-back off handling SCROLL cursors, but that behaviour has not been defined yet in DBI. Or, better yet, you could implement it and send me the modifications :-) > Do other RDBMS have the same auto-close on commit behavior? It depends on whether they adhere to the SQL standard or not; the standard says that COMMIT WORK closes all open cursors. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>