[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6125) Hibernate Criteria.setLockMode have unexpected behaviour when used in conjunction with MySQL
Darryl Miles (JIRA)
noreply at atlassian.com
Fri Mar 16 11:06:48 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45989#comment-45989 ]
Darryl Miles commented on HHH-6125:
-----------------------------------
Confirmed broken in 3.6.9.
Confirmed fixed in 3.6.10.
Both for MySQL usage.
> Hibernate Criteria.setLockMode have unexpected behaviour when used in conjunction with MySQL
> --------------------------------------------------------------------------------------------
>
> Key: HHH-6125
> URL: https://hibernate.onjira.com/browse/HHH-6125
> Project: Hibernate ORM
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list