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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]