You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Oliver Gutperl <ol...@gutperl.de> on 2001/03/06 23:56:34 UTC

autocommit in org.apache.turbine.util.db.pool.ConnectionPool

Hi!

I'm new to this list so I don't know if I ask something that has already
been discussed. But I scanned through the archives and found nothing about
this:

Wouldn't it make sense to do a setAutoCommit(true) whenever a Connection is
returned to the pool? Because otherwise somebody else might get a connection
which has autocommit disabled without expecting it.

Maybe even rollback() should be called when the connection is returned, so
uncomitted changes are not committed arbitrarily?

(I have checked some other Connection pools and none of them does any of the
above, so maybe I am missing the point entirely ???)

Best regards
Oliver

--
Dipl.-Ing. Oliver Gutperl
oliver@gutperl.de



Re: autocommit in org.apache.turbine.util.db.pool.ConnectionPool

Posted by Daniel Rall <dl...@collab.net>.
"Oliver Gutperl" <ol...@gutperl.de> writes:
> Wouldn't it make sense to do a setAutoCommit(true) whenever a Connection is
> returned to the pool? Because otherwise somebody else might get a connection
> which has autocommit disabled without expecting it.

It would make more sense to set it to the default for the database
adapter used to create the Connection.  I can't think of a reason off
hand not to do this.

> Maybe even rollback() should be called when the connection is returned, so
> uncomitted changes are not committed arbitrarily?

Interesting...

> (I have checked some other Connection pools and none of them does any of the
> above, so maybe I am missing the point entirely ???)

I would be interested in seeing a patch implementing these
suggestions.
-- 

Daniel Rall <dl...@collab.net>