cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle Deadlock when deleting record(s).

Former Member
0 Kudos

I have one method where I will delete record(s) in number of tables in single connection using a ExecuteBatch method. I will delete all the records table by table where the main table will be the last one in the list (to delete the children first then the parent record).

Sometimes, in production environment where there are huge no. of transactions going on at the same time, I might hit an Oracle Deadlock error when the code reaches the part to delete a record in the main table.

Is there any suggestion on how could I avoid this Oracle Deadlock error?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can not completely eliminate the possibility of a deadlock. You can however retry the operation when your oracle database rolls back the transaction. Oracle has mechanisms to detect deadlocks, and if detected it rolls back one of the two transactions. If you can catch the rollback you can retry the operation.

regards,

Dion