Thread $dbh->disconnect() wenn Objekt hinfällig (3 answers)
Opened by pktm at 2007-08-29 18:24

bloonix
 2007-09-05 00:25
#99104 #99104
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
DBI bzw Perl ist dein Freund. Du musst also nicht eine eigene sub DESTROY{}
schreiben.

Quote
The database is automatically disconnected by the DESTROY method
if still connected when there are no longer any references to the handle.
The DESTROY method for each driver should implicitly call rollback to undo any
uncommitted changes. This is vital behaviour to ensure that incomplete
transactions don't get committed simply because Perl calls DESTROY on every
object before exiting. Also, do not rely on the order of object destruction during
"global destruction", as it is undefined.
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread $dbh->disconnect() wenn Objekt hinfällig