Monday, August 6, 2012

How a deadlock situation occur in Oracle database?

Create a procedure and call a sub procedure within it which is a pragma Autonomous_transaction. Don't Commit or rollback the autonomous procedure.This will creat a deadlock situation.

The reason for this is if you declare any procedure as pragma autonomous_transaction then whatever changes are committed are within the scope of this procedure. If you don't commit the insert statement within this procedure it creats lock.

No comments:

Post a Comment