Hi,
I facing problem with locks on table when cocurrent updates are made to tables. There are multiple tables joined with foreign keys. What happens is that the while one update is in progress, the next update waits for locks to get released. The lock then lingers on the database, which has to be killed manually. The problem worsens if there are hundreds of users trying to update same entity in space of few seconds.
What happens beneath is that when updating this entity hibernate fires updates, followed by delete and then inserts. I remove objects from entity then do a flush(). I then add new objects into entity and I do merge() and then commit() all in same transaction.
Is there a way that these locks get release on its own once the updates are finished? Or is the problem is because I am doing flush(), merge() and commit() in same transaction?
Will greatly appreciate any reply
Thanks
|