SQL Language (MOSC)

MOSC Banner

deadlock prevention - enforce locking order

edited Aug 8, 2014 5:01AM in SQL Language (MOSC) 1 commentAnswered

I have a situation where 2 different logic flows lock/update the same logical structure.  The structure consists of a hierarchy of 2 tables with multiple rows to lock. The application logic flows use different SQL statements but tries to lock the tables in the same order.  The assumption is you have control over the order in which the logical rows are locked by using the ORDER BY and FOR UPDATE syntax.

For example,  FLIGHT->SEGMENT->LEG   (an Airline application where a flight is broken down into segments and legs of a flight)

SQL for flow #1

select <segment information>   from segment where flightid=?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center