Try OpenEdge Now
skip to main content
ABL Essentials
Handling Data and Locking Records : Record locking in ABL : Record locking examples
 

Record locking examples

A few simple examples can help illustrate how ABL handles different kinds of locks. When you start the Procedure Editor and connect to the Sports2000 database, you are running in single-user mode, as the only user of the database.
To set up your session to test locking:
1. Exit your session to free up your single-user connection to the Sports2000 database.
2. Make sure your path includes the bin directory under your OpenEdge install directory.
3. From a Windows Command Prompt window, change your directory to your working directory, or wherever your local Sports2000 database is located.
4. Type the command: proserve Sports2000. You should see a series of messages as the server starts up.
5. Restart the Procedure Editor.
6. From the Tools menu, select Database Connections.
7. Click the Connect button.
8. Type Sports2000 as the Physical Name, then click the Options button:
9. Check on the Multiple Users toggle box so that you connect to the server in multi-user mode:
10. Click OK, then close the Database Connections dialog box:
Now your session is connected to the database server. To test the effects of record locking in a multi-user environment, you need to create a second OpenEdge session.
To start up another session:
1. Start the Procedure Editor.
2. From the Tools menu, select Data Administration:
3. From the Data Administration menu, select Database, then click Connect.
4. Go through the same sequence of steps as before to connect in multi-user mode to the same Sports2000 database server.
Now you're ready to test locking conflicts.
* Using EXCLUSIVE-LOCKs
* Using and upgrading SHARE-LOCKS
* Using the NO-WAIT Option with the AVAILABLE and LOCKED functions
* Reading records with NO-LOCK