"SELECT ... FOR UPDATE" not working for Hibernate and MySQL

Posted by Andres Rodriguez on Stack Overflow See other posts from Stack Overflow or by Andres Rodriguez
Published on 2010-02-15T11:09:44Z Indexed on 2010/03/13 5:45 UTC
Read the original article Hit count: 487

Filed under:
|
|
|

Hi,

We have a system in which we must use pessimistic locking in one entity. We are using hibernate, so we use LockMode.UPGRADE. However, it does not lock.

  • The tables are InnoDB
  • We have checked that locking works correctly in the database (5.0.32), so this bug http://bugs.mysql.com/bug.php?id=18184 seems to be no problem.
  • We have checked that datasource includes the autoCommit = false parameter.
  • We have checked that the SQL hibernate (version 3.2) generates includes the " FOR UPDATE".

Thanks,

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about mysql