I've been experiencing very odd behaviour with regard to autocommit and 
abandoned connections. It seems that when connections are reclaimed that 
autocommit somehow becomes set to true. 

public void passivateObject(Object obj) throws Exception {
if(obj instanceof Connection) {
Connection conn = (Connection)obj;
if(!conn.getAutoCommit() && !conn.isReadOnly()) {
conn.rollback();
}
conn.clearWarnings();
conn.setAutoCommit(true);
}
if(obj instanceof DelegatingConnection) {
((DelegatingConnection)obj).passivate();
}
}


How can conn.setAutoCommit(true) possibly be the correct behaviour here? Is 
this correct?

Thanks,
Stephen

Reply via email to