commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kostas Papadopoulos" <kostas.g.papadopou...@gmail.com>
Subject Re: tomcat and setAutoCommit
Date Fri, 19 Oct 2007 04:21:34 GMT
Thanks,

This was issue DBCP-102. I should have checked there first. It is
marked resolved but it still sets autocommit to true in
passivateObject(), so it will need some work to remove the overhead.

kostas

On 10/19/07, Filip Hanik - Dev Lists <devlists@hanik.com> wrote:
> looks like it is hard coded in commons-dbcp to set autocommit to true
>
> PoolableConnectionFactory.java
>
> public void passivateObject(Object obj) throws Exception {
>         if(obj instanceof Connection) {
>             Connection conn = (Connection)obj;
>             if(!conn.getAutoCommit() && !conn.isReadOnly()) {
>                 conn.rollback();
>             }
>             conn.clearWarnings();
>             if(!conn.getAutoCommit()) {
>                 conn.setAutoCommit(true);
>             }
>         }
>         if(obj instanceof DelegatingConnection) {
>             ((DelegatingConnection)obj).passivate();
>         }
>     }
>
> If you feel this is incorrect, or cause overhead, then file a bug with
> the DBCP folks
>
> Filip
>
> Kostas Papadopoulos wrote:
> > I'm using tomcat/jdbc/mysql with the tomcat suplied DBCP connection
> > pool configured with defaultAutoCommit=false. After tracing the
> > queries sent to the database, I've noticed that a "set autocommit=1"
> > is always followed by "set autocommit=0". I'm not sure who is setting
> > "autocommit=1", probably the connection.close()  in the pool
> > somewhere.
> >
> > Is there a way to make it stop? Can anyone know of a reason why this
> > would be needed?
> >
> > Thanks
> > Kostas
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message