Hello

It seems there is a feature in DBD::mysql (when used with InnoDB) 
that get's in the way in some circumstances:

We are doing some code like the following (in a mod_perl environment) 
with $dbh being opened with RaiseError and Autocommit=0:

$dbh->commit; # get to the latest snapshot of the data
$sth->execute some select statement

If the database connection has been closed because of a timeout, the 
commit will give an exception because of "mysql has gone away".

I'm used to the behaviour (with non-transaction tables in mysql) that 
dbi/DBD::mysql reopens database connections transparently. This is 
not the case anymore, since now in some cases there will be an 
exception in others not. And I really didn't expect an exception in 
the above.

I guess the above behaviour is because of the possibility of a case 
where you issue some statements without committing them, then the 
connection goes away, then you issue commit (maybe after another few 
statements), this would give problems.

But dbi/dbd could handle my situation differently: if (and only if) 
the connection did go away *between two commits*, there is no reason 
to give an error. (To rephrase: If I issue some data modifying 
statements, do a commit (which succeeds), then the connection goes 
away, and I do another commit (for the sole purpose to get a recent 
snapshot), don't give an error since I won't expect it and won't know 
what to do with it.)

Unless I'm missing something I would put this as a feature request. :)

Thanks,
Christian
-- 
Christian Jaeger  Programmer & System Engineer  +41 1 430 45 26
ETHLife CMS Project - warehouse.ch/ethlife/www - www.ethlife.ethz.ch

Reply via email to