Example - locking objects
Published 23 March 2022
Object locking is only available in Source Control for Oracle 2 and later.
In this example, James and Michael work at Widget Development Ltd.
James is fixing a bug in the Widget Development website. To do this, he needs to work on three database objects:
- a trigger, WidgetTrigger
- a package, WidgetPackage
- a package body, also named WidgetPackage
James doesn't want anyone to edit these objects while he's working on them, so he decides to lock them.
To do this, in Source Control for Oracle 2, he goes to the Locking tab. In the Unlocked objects pane, he selects the objects and types a comment explaining why he's locking them:
He clicks Lock selected objects.
The objects are moved to the Locked objects pane:
The objects are now locked and can't be edited by others.
Meanwhile, Michael decides to drop the locked object WidgetPackage in Oracle SQL Developer. He doesn't realize James is working on it. When he tries to drop the object, the server returns an error message:
The error contains the comment James wrote when he locked the object: Fixing [WW-56] bug.