Announcement Announcement Module
No announcement yet.
Deadlock and isolation level Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deadlock and isolation level

    Hello All.

    I have the following problem: I have two thread that invoke the same method - methodA(). First thread starts first transaction and lock some data for update, when second thread starts second transaction. The first transaction is suspended and the second transaction tries to update the same data that have been locked by the first transaction and deadlock exception happens.

    I try use
    @Transactional(propagation=Propagation.REQUIRED, isolation=Isolation.SERIALIZABLE)
    but without change.

    In my case solution in that the second transactions starts after the first has been finished - good.
    How can I resolve this problem? I use Hibernate 3 and MySQL.