org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction

Hibernate JIRA | Rudi Wijaya | 2 years ago
  1. 0

    When querying then `merge()`-ing an entity without `@Version`, Hibernate throws NPE: {code} 14:50:36.200 ERROR | | | eduler_Worker-10 | o.h.AssertionFailure | HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): java.lang.NullPointerException 14:50:36.202 ERROR | | | eduler_Worker-10 | i.c.b.c.ExpireCartLineJob | Can not to cancel cartLine for cart 52ce397d-91f5-43fe-a8d0-027db3ac938d line 71e4995c-15e9-4d7a-acb6-8c9497bdd868 at scheduled Wed Oct 29 03:20:02 VET 2014: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:524) ~[spring-orm-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at id.co.bippo.cart.JpaCartManagerImpl.expireCartLine(JpaCartManagerImpl.java:789) ~[classes/:na] at id.co.bippo.cart.ExpireCartLineJob.doExecute(ExpireCartLineJob.java:81) ~[classes/:na] at org.soluvas.schedule.TenantJob.execute(TenantJob.java:117) [classes/:na] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.2.1.jar:na] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) ~[quartz-2.2.1.jar:na] Caused by: javax.persistence.RollbackException: Error while committing the transaction at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:94) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final] at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:515) ~[spring-orm-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 8 common frames omitted Caused by: org.hibernate.AssertionFailure: Unable to perform beforeTransactionCompletion callback at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:721) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:389) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:516) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:105) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:77) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final] ... 9 common frames omitted Caused by: java.lang.NullPointerException: null at org.hibernate.action.internal.EntityVerifyVersionProcess.doBeforeTransactionCompletion(EntityVerifyVersionProcess.java:59) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:715) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] ... 14 common frames omitted {code} Hibernate should throw an exception with technical explanation reason of the failure, for example whether a required annotation is missing. Similar issues: 1. https://developer.jboss.org/thread/173302?_sscc=t 2. http://stackoverflow.com/questions/5727565/hibernate-throws-nullpointerexception-in-entityverifyversionprocess Tag [~ceefour]

    Hibernate JIRA | 2 years ago | Rudi Wijaya
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
  2. 0

    When querying then `merge()`-ing an entity without `@Version`, Hibernate throws NPE: {code} 14:50:36.200 ERROR | | | eduler_Worker-10 | o.h.AssertionFailure | HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): java.lang.NullPointerException 14:50:36.202 ERROR | | | eduler_Worker-10 | i.c.b.c.ExpireCartLineJob | Can not to cancel cartLine for cart 52ce397d-91f5-43fe-a8d0-027db3ac938d line 71e4995c-15e9-4d7a-acb6-8c9497bdd868 at scheduled Wed Oct 29 03:20:02 VET 2014: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:524) ~[spring-orm-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150) ~[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE] at id.co.bippo.cart.JpaCartManagerImpl.expireCartLine(JpaCartManagerImpl.java:789) ~[classes/:na] at id.co.bippo.cart.ExpireCartLineJob.doExecute(ExpireCartLineJob.java:81) ~[classes/:na] at org.soluvas.schedule.TenantJob.execute(TenantJob.java:117) [classes/:na] at org.quartz.core.JobRunShell.run(JobRunShell.java:202) ~[quartz-2.2.1.jar:na] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) ~[quartz-2.2.1.jar:na] Caused by: javax.persistence.RollbackException: Error while committing the transaction at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:94) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final] at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:515) ~[spring-orm-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 8 common frames omitted Caused by: org.hibernate.AssertionFailure: Unable to perform beforeTransactionCompletion callback at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:721) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:389) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:516) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:105) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:77) ~[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final] ... 9 common frames omitted Caused by: java.lang.NullPointerException: null at org.hibernate.action.internal.EntityVerifyVersionProcess.doBeforeTransactionCompletion(EntityVerifyVersionProcess.java:59) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] at org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:715) ~[hibernate-core-4.3.6.Final.jar:4.3.6.Final] ... 14 common frames omitted {code} Hibernate should throw an exception with technical explanation reason of the failure, for example whether a required annotation is missing. Similar issues: 1. https://developer.jboss.org/thread/173302?_sscc=t 2. http://stackoverflow.com/questions/5727565/hibernate-throws-nullpointerexception-in-entityverifyversionprocess Tag [~ceefour]

    Hibernate JIRA | 2 years ago | Rudi Wijaya
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error while committing the transaction
  3. 0

    [HHH-9462] Updating non-@Version-ed entity with LockModeType.OPTIMISTIC throws NullPointerException: null at org.hibernate.action.internal.EntityVerifyVersionProcess.doBeforeTransactionCompletion - Hibernate JIRA

    atlassian.net | 1 year ago
    org.springframework.transaction.TransactionSystemException: Could not commit JPA transaction; nested exception is javax.persistence.RollbackException: Error committing the transaction
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    error with allocine

    GitHub | 2 years ago | jluc2808
    org.hibernate.AssertionFailure: null id in org.yamj.core.database.model.CastCrew entry (don't flush the Session after an exception occurs)
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.NullPointerException

    null

    at org.hibernate.action.internal.EntityVerifyVersionProcess.doBeforeTransactionCompletion()
  2. Hibernate
    AbstractTransactionImpl.commit
    1. org.hibernate.action.internal.EntityVerifyVersionProcess.doBeforeTransactionCompletion(EntityVerifyVersionProcess.java:59)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    2. org.hibernate.engine.spi.ActionQueue$BeforeTransactionCompletionProcessQueue.beforeTransactionCompletion(ActionQueue.java:715)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    3. org.hibernate.engine.spi.ActionQueue.beforeTransactionCompletion(ActionQueue.java:389)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    4. org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:516)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    5. org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:105)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    6. org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:177)[hibernate-core-4.3.6.Final.jar:4.3.6.Final]
    6 frames
  3. org.hibernate.jpa
    TransactionImpl.commit
    1. org.hibernate.jpa.internal.TransactionImpl.commit(TransactionImpl.java:77)[hibernate-entitymanager-4.3.6.Final.jar:4.3.6.Final]
    1 frame
  4. Spring ORM
    JpaTransactionManager.doCommit
    1. org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:515)[spring-orm-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    1 frame
  5. Spring Tx
    TransactionTemplate.execute
    1. org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757)[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726)[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150)[spring-tx-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3 frames
  6. id.co.bippo
    ExpireCartLineJob.doExecute
    1. id.co.bippo.cart.JpaCartManagerImpl.expireCartLine(JpaCartManagerImpl.java:789)[classes/:na]
    2. id.co.bippo.cart.ExpireCartLineJob.doExecute(ExpireCartLineJob.java:81)[classes/:na]
    2 frames
  7. org.soluvas.schedule
    TenantJob.execute
    1. org.soluvas.schedule.TenantJob.execute(TenantJob.java:117)[classes/:na]
    1 frame
  8. quartz
    SimpleThreadPool$WorkerThread.run
    1. org.quartz.core.JobRunShell.run(JobRunShell.java:202)[quartz-2.2.1.jar:na]
    2. org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)[quartz-2.2.1.jar:na]
    2 frames