commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <phil.ste...@gmail.com>
Subject Re: tomcat and setAutoCommit
Date Sat, 03 Nov 2007 22:55:55 GMT
On 10/18/07, Kostas Papadopoulos <kostas.g.papadopoulos@gmail.com> wrote:
> 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
>

See the comments in DBCP-102 and DBCP-97.
The hard-coded *true* value for autoCommit in passivateObject was
introduced to resolve DBCP-97 in r132043 (DBCP 1.1 release)

If you disagree with the reasons given in DBCP-97, go ahead and reopen DBCP-102.

Thanks.

Phil




> 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
>
>

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


Mime
View raw message