Reputation: 577
I use MySQL with the DBI Module for my perl programming database connections. I got the error message as below when using mysql :
Issuing rollback() due to DESTROY without explicit disconnect() of
DBD::mysql::db handle db=db;ip=X.X.X.X; at /code/save2db.plx line 104.
DBD::mysql::db DESTROY failed: MySQL server has gone away at
/code/save2db.plx line 104.
(in cleanup) DBD::mysql::db DESTROY failed: MySQL server has gone away
at /code/save2db.plx line 104.
the line 104 in my code is
103 $dbh->disconnect;
104 exit;
Any idea why this happens? I'd appreciate any feedback.
Upvotes: 1
Views: 2065
Reputation: 2891
The transaction behaviour of the
disconnect
method is, sadly, undefined. Some database systems (such as Oracle and Ingres) will automatically commit any outstanding changes, but others (such as Informix) will rollback any outstanding changes. Applications not usingAutoCommit
should explicitly callcommit
orrollback
before calling disconnect.
See https://metacpan.org/pod/DBI#disconnect
Upvotes: 1