Release Locks - lucienlazar/plsql-application-locking Wiki

In this section we will see how we complete the two process runs and how we release the application locks for one of these two processes.

The first process will complete successfully and release its locks, while the second process will fail and will not release its locks, leaving orphan locks in the system.

Step 6: complete process run P1 successfully and release its locks

We complete process P1 using the procedure end_process in package processing with status completed successfully (1).

The record with run id 1 from the process runs table was updated with run status completed successfully (1) and current date as end date.

The locks with lock id 1 and 2 from the application locks table belonging to run id 1 were deleted.

Step 7: complete process run P2 with errors and do not release its locks

We complete process P2 using the procedure end_process in package processing with status failed (2).

The record with run id 2 from the process runs table was updated with run status failed (2) and current date as end date.

The lock with lock id 3 from the application locks table belonging to run id 2 remained.