[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6125) Hibernate Criteria.setLockMode have unexpected behaviour when used in conjunction with MySQL

Eric Poitras (JIRA) noreply at atlassian.com
Fri Apr 15 09:05:59 EDT 2011


Hibernate Criteria.setLockMode have unexpected behaviour when used in conjunction with MySQL
--------------------------------------------------------------------------------------------

                 Key: HHH-6125
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6125
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.2
         Environment: Hibernate 3.6.2, MySql 5.1
            Reporter: Eric Poitras
            Priority: Minor
         Attachments: TestHibernate.java

You expect hibernate to issue a select ... for update when issuing a Criteria of this form:

// This fails
Criteria c = s.createCriteria(SampleEntity.class);
c.setLockMode( LockMode.PESSIMISTIC_WRITE );
SampleEntity e = (SampleEntity) c.uniqueResult();

But the MySQL dialect class simply ignore the lock mode per alias since MySQL does not support a per-table locking strategy. However, in the previous case, 
it should issue a for update since we access ALL query tables in update.

Also, since pessimistic lock may be critical for some process synchronization, it should AT LEAST not silently fail.



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

        


More information about the hibernate-issues mailing list