[prev in list] [next in list] [prev in thread] [next in thread]
List: ojb-user
Subject: Re: Exception thrown from abortTransaction (patch needed ?)
From: Armin Waibel <arminw () apache ! org>
Date: 2004-05-25 13:22:39
Message-ID: 40B3489F.9030107 () apache ! org
[Download RAW message or body]
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: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic