On Nov 27, 2006, at 11:16 PM, Philip M. Gollucci wrote:
In testing out persistent connections while using transactions,
we've noticed that while in a loop which continuously begins and
ends a transaction, killing the persistent connection which
Apache::DBI is maintaining causes the still-running handler to
report things like:
error: DBD driver has not implemented the AutoCommit attribute at /
usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/DBI.pm
line 1668.
In dumping the status of the handle after this has been done, the
AutoCommit flag is no longer there either.
$Apache::DBI::Debug = 2;
$dbh->trace('file', 4);
Below is the resultant log file - here, Transaction.pm has a call to
begin_work which turns off AutoCommit:
-------------- snippet of log while connection is still up
----------------
-> commit for DBD::mysql::db (DBI::db=HASH(0x9b8678c)~0x9bf49cc)
thr#915dc30
<- commit= 1 at /some/source/path/Transaction.pm line 38 via
at /some/source/path/SomeModule.pm line 36
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit' 1) thr#915dc30
1 <- STORE= 1 at /some/source/path/Transaction.pm line 38 via at /
some/source/path/SomeModule.pm line 36
-> begin_work for DBD::mysql::db (DBI::db=HASH(0x9b8678c)
~0x9bf49cc) thr#915dc30
1 -> FETCH for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit') thr#915dc30
1 <- FETCH= 1 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-
multi/DBI.pm line 1666 via at /some/source/path/Transaction.pm line 23
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit' 0) thr#915dc30
1 <- STORE= 1 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-
multi/DBI.pm line 1668 via at /some/source/path/Transaction.pm line 23
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'BegunWork' 1) thr#915dc30
STORE DBI::db=HASH(0x9bf49cc) 'BegunWork' => 1
------------------------------------------------------------------------
----
-------------- snippet of log while connection is down ----------------
<- commit= 1 at /some/source/path/Transaction.pm line 38 via
at /some/source/path/SomeModule.pm line 36
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit' 1) thr#915dc30
1 <- STORE= 1 at /some/source/path/Transaction.pm line 38 via at /
some/source/path/SomeModule.pm line 36
-> begin_work for DBD::mysql::db (DBI::db=HASH(0x9b8678c)
~0x9bf49cc) thr#915dc30
1 -> FETCH for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit') thr#915dc30
1 <- FETCH= 1 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-
multi/DBI.pm line 1666 via at /some/source/path/Transaction.pm line 23
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit' 0) thr#915dc30
--> do_error
Turning off AutoCommit failed error 21 recorded: Turning off
AutoCommit failed
<-- do_error
STORE DBI::db=HASH(0x9bf49cc) 'AutoCommit' => 0
!! ERROR: 21 CLEARED by call to begin_work method
-> begin_work for DBD::mysql::db (DBI::db=HASH(0x9b8678c)
~0x9bf49cc) thr#915dc30
1 -> FETCH for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit') thr#915dc30
1 <- FETCH= 1 at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-
multi/DBI.pm line 1666 via at /some/source/path/Transaction.pm line 23
1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER
'AutoCommit' 0) thr#915dc30
------------------------------------------------------------------------
----
thanks!
-lev