[JBoss JIRA] Created: (JBPM-2964) Throw the exception on commit when both commit and rollback fail
by Toshiya Kobayashi (JIRA)
Throw the exception on commit when both commit and rollback fail
----------------------------------------------------------------
Key: JBPM-2964
URL: https://jira.jboss.org/browse/JBPM-2964
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.9
Reporter: Toshiya Kobayashi
In case that commit() throws an exception (e.g. StaleObjectStateException) in DbPersistenceService.endTransaction(), rollback() will be called. And then, if rollback() also throws an exception, a client application will get the latter exception (Usually, it would be java.lang.IllegalStateException: BaseTransaction.rollback - [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] [com.arjuna.ats.internal.jta.transaction.arjunacore.notx] no transaction! ).
public void endTransaction() {
if (!isTransactionRollbackOnly()) {
Exception commitException = commit();
if (commitException != null) {
rollback();
closeSession();
closeConnection();
throw new JbpmPersistenceException("transaction commit failed", commitException);
}
}
It is not a desirable behaviour. It's better to catch the exception on rollback, log it and throw the exception on commit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira