[jbpm-issues] [JBoss JIRA] Commented: (JBPM-1465) NullPointerException on transaction.rollback() in DbPersistenceService

Alejandro Guizar (JIRA) jira-events at lists.jboss.org
Tue Aug 19 20:10:22 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBPM-1465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12425781#action_12425781 ] 

Alejandro Guizar commented on JBPM-1465:
----------------------------------------

In my test the NPE is suppresed by the rollback() method itself and does not affect product operation. It simply causes a possibly annoying yet harmless exception trace to be printed:

18:27:21,754 ERROR [DbPersistenceService] hibernate rollback failed
java.lang.NullPointerException
	at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:308)
	at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:238)
	at org.jbpm.svc.Services.close(Services.java:236)
	at org.jbpm.JbpmContext.close(JbpmContext.java:139)
	at org.jbpm.persistence.db.PersistenceDbServiceNoTxTest.testFlushException(PersistenceDbServiceNoTxTest.java:179)

Removing the rollback() call eliminates the exception trace. However, I did not see how this could affect our users, apart from the bogus error message.

> NullPointerException on transaction.rollback() in DbPersistenceService
> ----------------------------------------------------------------------
>
>                 Key: JBPM-1465
>                 URL: https://jira.jboss.org/jira/browse/JBPM-1465
>             Project: JBoss jBPM
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: SOA 4.2 CP02, jPDL 3.2.3
>            Reporter: Martin Putz
>            Assignee: Alejandro Guizar
>
> We are having NullPointerException from DbPersistenceService when Hibernate throws Exception on close() method. The line is transaction.rollback(); in rollback() method. My two cents is this code should be embraced with "if ( isTransactionEnabled && (transaction != null) )" statement, because we are using external JDBC Connection provider, and the transaction reference never be set.
> All calls to the rollback() method in DbPersistenceService are already preceded by a check for
>    if ( (isTransactionEnabled)
>         && (transaction!=null)
>       ) {
> except this one after an exception has happened during the Hibernate session.flush call:
>     Exception flushException = flushSession();
>     if (flushException!=null) {
>       rollback();                         // missing check if there is a transaction 
>       closeSession();
>       closeConnection();
>       throw new JbpmPersistenceException("hibernate flush failed", flushException);
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbpm-issues mailing list