Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lock table in exclusive mode+atomicity

user610868Jul 29 2013 — edited Jul 31 2013

Hi,

I'm kicking off the same java process in parallel. The max process count is about 30.

Each of these processses are updating the same set of tables (at least 5 tables).

No surprise i get deadlock message from Oracle by running 30 processes in parallel.

My current solution to this problem is to lock the tables at the begining of the transaction with the statement (i'm know this is suboptimal, but i have no other choise):

LOCK TABLE table1, table2, table3, table4, table5 IN EXCLUSIVE MODE

The situation got much better, but in rare cases, i still get deadlock:

CODE: "UNSPECIFIC_SQL_EXCEPTION"

MESSAGE: "unspecific sql-exception: ORA-00060: deadlock detected while waiting for resource

; SQL-Statement: SQL:LOCK TABLE table1, table2, table3, table4, table5 IN EXCLUSIVE MODE"

How is this possible? Isn't the LOCK TABLE statement atomic ?

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2013
Added on Jul 29 2013
11 comments
2,022 views