I've got a big inherited application, and lo and behold, rollback() and transactions don't work. I doubt anyone can
solve the problem for me, but where can I at least look? How might these transactions get committed? I do something simple like:
Code:
object.setSomething("test " + new Date);
mySession.rollback();
And yet the data gets committed. The rollback implementation is:
Code:
public abstract class AbstractHibernatePersister implements PersistenceManager {
....
public void rollback() throws PersistenceException {
logger.error("rollback()");
Session session = this.getSession();
if( session != null ) {
try {
session.connection().rollback();
logger.error("session.connection().rollback() " + session.connection().getAutoCommit() + " isolation=" + session.connection().getTransactionIsolation());
} catch( Exception e ) {
throw new PersistenceException(e);
}
}
}
...
And yes autoCommit is false, and the isolation level is 2. This is hibernate 2.1.4, on a xwork/webwork platform, with Java 1.4.2 and JDBC with Postgres 8.current as the database.
There is a mysterious comment in the code:
Code:
/**
* Suppressing rollback functionality is required to allow centralized management of transaction state. The
* individual managers no longer control where the transaction boundaries are, but rather the system controls it
* through interceptors.
*/
And the code I'm working with does seem to extend a lot of classes.