Hi Guillaume,

your patch makes sense IMO.
Is in CVS now. Thanks for the patch.

regards
Armin

Guillaume Nodet wrote:

I've got the following error that is thrown when rolling back a transaction.

org.apache.ojb.broker.PersistenceBrokerException: Set autoCommit(false)
failed
        at
org.apache.ojb.broker.platforms.PlatformDefaultImpl.changeAutoCommitState(Pl
atformDefaultImpl.java:208)
        at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.restoreAutoCommitSta
te(ConnectionManagerImpl.java:244)
        at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Connec
tionManagerImpl.java:229)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.abortTransaction(Persistenc
eBrokerImpl.java:371)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
gatingPersistenceBroker.java:149)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.abortTransaction(Dele
gatingPersistenceBroker.java:149)
        ...

This exception is ok because the database has been shut down, but it is
thrown from the finally statement in the
ConnectionMagagerImpl.localRollback method. In this piece of code, the
connection is rolled back and SQLException are catched and logged (not
rethrown). The problem is when the restoreAutoCommitState is called
and fails, the exception i wrote above is thrown.
So my question is: why do the localRollback method catches sql exceptions
launched from rollback and not from the restoreAutoCommitState ?

Maybe the finally statement of the ConnectionMagagerImpl.localRollback could
be:

        finally
        {
                try {
                restoreAutoCommitState();
                } catch (OJBRuntimeException e) {
                        // Ignore or log exception
                }
            this.releaseConnection();
        }

Cheers,
Guillaume


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



Reply via email to