Demo - lucienlazar/plsql-application-locking GitHub Wiki

In the next sections you will see a demo with multiple flows of using the PL/SQL Application Locking framework.

The demo will have 3 sections with different scenarios for:

  • acquire lock: we will see how we start two process runs, how only one process can set a write exclusive application lock on a table at a time to write in it and how two parallel processes can set shared application locks on the same table at the same time to read from it.

  • release locks: we will see how we complete one process run successfully and release its locks, while the second process will fail and will not release its locks, leaving orphan locks in the system.

  • release orphan locks: we will see how we start a third process run that needs to use a table which remained locked by another completed process run and how the third process run will release that orphan lock.

You can download and run the demo.sql script that contains all the flows of using the PL/SQL Application Locking framework.