org.hibernate.exception.LockAcquisitionException: could not execute statement

Atlassian JIRA | Lukasz Pater | 11 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    When accessing multiple projects concurrently you might get an exception similar to: {code} 2016-03-16 06:59:37,256 ERROR [qtp1768952842-308 ] fisheye SessionState-commitAllTx - Commit failed. Rolling back. org.hibernate.exception.LockAcquisitionException: could not execute statement at org.hibernate.dialect.PostgreSQL81Dialect$2.convert(PostgreSQL81Dialect.java:388) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:58) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1157) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.action.internal.CollectionRemoveAction.execute(CollectionRemoveAction.java:111) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:307) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at com.cenqua.crucible.hibernate.SessionState.commit(SessionState.java:165) [fisheye.jar:?] at com.cenqua.crucible.hibernate.SessionState.commitAllTx(SessionState.java:118) [fisheye.jar:?] at com.cenqua.crucible.hibernate.SessionState.commitTx(SessionState.java:109) [fisheye.jar:?] at com.cenqua.crucible.hibernate.HibernateUtil.commitTransaction(HibernateUtil.java:385) [fisheye.jar:?] ... Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 94047 waits for ShareLock on transaction 177190; blocked by process 95026. Process 95026 waits for ShareLock on transaction 177191; blocked by process 94047. Hint: See server log for query details. {code} The exact wording may differ based on the database being used.

    Atlassian JIRA | 11 months ago | Lukasz Pater
    org.hibernate.exception.LockAcquisitionException: could not execute statement
  2. 0

    When accessing multiple projects concurrently you might get an exception similar to: {code} 2016-03-16 06:59:37,256 ERROR [qtp1768952842-308 ] fisheye SessionState-commitAllTx - Commit failed. Rolling back. org.hibernate.exception.LockAcquisitionException: could not execute statement at org.hibernate.dialect.PostgreSQL81Dialect$2.convert(PostgreSQL81Dialect.java:388) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:58) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1157) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.action.internal.CollectionRemoveAction.execute(CollectionRemoveAction.java:111) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:307) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at com.cenqua.crucible.hibernate.SessionState.commit(SessionState.java:165) [fisheye.jar:?] at com.cenqua.crucible.hibernate.SessionState.commitAllTx(SessionState.java:118) [fisheye.jar:?] at com.cenqua.crucible.hibernate.SessionState.commitTx(SessionState.java:109) [fisheye.jar:?] at com.cenqua.crucible.hibernate.HibernateUtil.commitTransaction(HibernateUtil.java:385) [fisheye.jar:?] ... Caused by: org.postgresql.util.PSQLException: ERROR: deadlock detected Detail: Process 94047 waits for ShareLock on transaction 177190; blocked by process 95026. Process 95026 waits for ShareLock on transaction 177191; blocked by process 94047. Hint: See server log for query details. {code} The exact wording may differ based on the database being used.

    Atlassian JIRA | 11 months ago | Lukasz Pater
    org.hibernate.exception.LockAcquisitionException: could not execute statement

  1. linxiaolong 1 times, last 2 months ago
1 unregistered visitors

Root Cause Analysis

  1. org.hibernate.exception.LockAcquisitionException

    could not execute statement

    at org.hibernate.dialect.PostgreSQL81Dialect$2.convert()
  2. Hibernate
    AbstractTransactionImpl.commit
    1. org.hibernate.dialect.PostgreSQL81Dialect$2.convert(PostgreSQL81Dialect.java:388)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    2. org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    3. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    4. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    5. org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    6. org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:58)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    7. org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:1157)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    8. org.hibernate.action.internal.CollectionRemoveAction.execute(CollectionRemoveAction.java:111)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    9. org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    10. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:387)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    11. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:307)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    12. org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:349)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    13. org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    14. org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1159)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    15. org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    16. org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    17. org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)[hibernate-core-4.2.13.Final.jar:4.2.13.Final]
    17 frames
  3. com.cenqua.crucible
    HibernateUtil.commitTransaction
    1. com.cenqua.crucible.hibernate.SessionState.commit(SessionState.java:165)[fisheye.jar:?]
    2. com.cenqua.crucible.hibernate.SessionState.commitAllTx(SessionState.java:118)[fisheye.jar:?]
    3. com.cenqua.crucible.hibernate.SessionState.commitTx(SessionState.java:109)[fisheye.jar:?]
    4. com.cenqua.crucible.hibernate.HibernateUtil.commitTransaction(HibernateUtil.java:385)[fisheye.jar:?]
    4 frames