[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6865) PessimisticLockException should be thrown when pessimistic read and write locking strategies fail

Gail Badner (JIRA) noreply at atlassian.com
Wed Nov 30 08:37:22 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44473#comment-44473 ] 

Gail Badner commented on HHH-6865:
----------------------------------

Most of the failures in LockTest on Oracle are because the Oracle exception is ORA-30006 with sqlstate=99999. The sqlstate is non-informative and GenericJDBCException is thrown. Extending SQLExceptionConverter for Oracle and converting to PessimisticLockException when SQLException.getErrorCode() == 30006 would work for these cases.

LockTest.testContendedPessimisticWriteLockNoWait() results in an ORA-00054 with sqlstate=61000, which Hibernate converts into org.hibernate.exception.LockAcquisitionException.

 

> PessimisticLockException should be thrown when pessimistic read and write locking strategies fail
> -------------------------------------------------------------------------------------------------
>
>                 Key: HHH-6865
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6865
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.CR6
>            Reporter: Gail Badner
>            Assignee: Gail Badner
>             Fix For: 4.0.0.next
>
>
> In some cases, when a pessimistic read/write locking strategy fails with SQLException, Hibernate converts the SQLException to a org.hibernate.JDBCException, but does not wrap the JDBCException in a org.hibernate.PessimisticLockException.
> This affects:
> PessimisticReadSelectLockingStrategy.lock(...)
> PessimisticReadUpdateLockingStrategy.lock(...)
> PessimisticWriteSelectLockingStrategy.lock(...)
> PessimisticWriteUpdateLockingStrategy.lock(...)
> These methods specifically catch SQLException, convert it to a org.hibernate.JDBCException, and wrap in a org.hibernate.PessimisticLockException.
> If Hibernate does the conversion immediately when the statement fails and throws JDBCException, then lock(...) does not have the opportunity to catch it and wrap it in a org.hibernate.PessimisticLockException.
> This issue is reproduced in LockTest failures on Oracle.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list