Create Lock
Use this command to lock sections of data in the Data Server repository. A lock is a Data Server repository security feature preventing a data intersection from being changed by another user or process until an operation is completed and the data intersection is released.
Use this command to create an explicit lock. The lock is “explicit” because it occurs only when you issue the appropriate commands. In conjunction with the Create Lock command, specify a DataSpec to limit the scope of symbols to lock.
If you use this command in conjunction with the UseInputRelatedSchedules command, the original DataArea is locked along with the related DataAreas for line item details, comments, and attachments.
For information on how this command is affected by input-related schedules, see UseInputRelatedSchedules.
Syntax:
CREATE LOCK USER|ADMIN USING dataspec.lvdsp [JECHECK] ["Comment"] [PERSISTENT]
where:
- USER creates a lock that is owned by the current user.
- ADMIN creates a lock that is owned by the DBO. Admin locks are always maintained when an Application Framework session ends because a timeout is reached or a connection is lost.
- USING creates the lock based on the DataSpec defined by a DataSpec file.
- dataspec.lvdsp is the name of a DataSpec file.
- JECHECK checks for unposted or temporarily posted journal entries before creating the lock. If any exist, the lock does not occur, and an error message appears.
- "Comment" is a character string to be used as the lock comment.
- Enclose in double quotation marks.
- To include double quotation marks in the character string, precede the interior double quotation marks with a backslash ( \ ).
- PERSISTENT applies only to USER locks when your system is configured to use session locks. This parameter indicates that the lock should be created as a persistent lock. If you do not use this parameter, user locks are created as session locks, which are released when an Application Framework session ends because a timeout is reached or a connection is lost. If your system is not configured to use session locks, all user locks are persistent and must be deleted manually.
Syntax example:
CREATE LOCK User USING SubmitAdj.lvdsp "Submission of Adjustments" PERSISTENT
See also