Tuesday, 15 May 2012

Oracle, 2 procedures avoid deadlock -


I have two processes that I would like to run on a single table, use a date of birth and other update names and Last name is taken from the third table.

The person who uses Birthdays to update the age field runs on all the table, and who updates the name and last name only updates the rows that are in the third table Based on the key.

So I launched both and got it! Is there any way to give priority to any of them? I read about the nowait and shut down for updates, but then, how do I return people left?

Hope you can help me on this !!

There is a possibility that you update all the rows at one time. All updates to the same update statement will complete it.

 Whatever you choose from T ... for updates ...  

There is another solution that I call " Gatekeeper "table, both processes must lock the gatekeeper table in the unique first unique mode to update the table in question. The second process will be blocked until the first is committed, but the deadlock will not happen. In 11G you can create a table with allocated space.

There is a difference in putting a line in the gatekeeper, then only lock that row with the selection for the update, then you can use the gatekeeper in other situations.

No comments:

Post a Comment