org.hibernate.dialect.lock.PessimisticEntityLockException

could not obtain pessimistic lock

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web99

  • via Unknown by harry clark,
  • via Unknown by harry clark,
  • via Unknown by 199947,
  • Stack trace

    • org.hibernate.dialect.lock.PessimisticEntityLockException: could not obtain pessimistic lock at org.hibernate.dialect.lock.PessimisticWriteSelectLockingStrategy.lock(PessimisticWriteSelectLockingStrategy.java:114) at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1896) at org.hibernate.event.internal.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:99) at org.hibernate.event.internal.DefaultLockEventListener.onLock(DefaultLockEventListener.java:85) at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:811) at org.hibernate.internal.SessionImpl.fireLock(SessionImpl.java:804) at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:172) at org.hibernate.internal.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2365) at com.kve.vanguard.model.orm.dao.Dao.lock(Dao.java:258) at com.kve.locktest.main.Main.main(Main.java:46) Caused by: org.hibernate.exception.SQLGrammarException: [SQL0104] Token UPDATE was not valid. Valid tokens: EXCLUSIVE. at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:122) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:146) at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) at sun.proxy.$Proxy21.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$1.doPrepare(StatementPreparerImpl.java:84) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareStatement(StatementPreparerImpl.java:71) at org.hibernate.dialect.lock.PessimisticWriteSelectLockingStrategy.lock(PessimisticWriteSelectLockingStrategy.java:75) ... 9 more Caused by: java.sql.SQLException: [SQL0104] Token UPDATE was not valid. Valid tokens: EXCLUSIVE. at com.ibm.as400.access.JDError.throwSQLException(JDError.java:650) at com.ibm.as400.access.JDError.throwSQLException(JDError.java:621) at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1557) at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:193) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:2025) at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1824) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) ... 15 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    marcbouvierdavmarcbouvierdav
    2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    3 more bugmates