There are 3 levels of Object Locking implemented by the Visual LANSA development environment:
Note: For indirect methods of modifying this behavior in LANSA, refer to Special Authorities and Task Tracking.
Also note that the use of Specialised BIFs and the ROM interface count as another instance of Visual LANSA.
All these locks are automatically applied when the developer performs a specific action. For example, the developer attempts to edit a Form on a Slave system. Under the covers, Visual LANSA will obtain a System-wide lock on the Form to ensure that no other workstation has it locked and that it is locked to the current Task Id. A Database-wide Lock will also be obtained to ensure that only one developer on the current database is editing it at this moment.
The following is what occurs when it's a Slave system. There is a section at the end of this topic on differences with Independent Systems.
System-wide Locks
A System-wide Lock consists of a Task ID and a Workstation. Users may share the right to use a Task Id, but the Workstation must be unique. When an object is created or is checked out for update from the Master, the Task Id and Workstation are assigned to the object. Refer to 6.1.2 Task Tracking Concepts and Unlock Objects in Task Tracking for more information on Task Id.
The Workstation is the principal means of ensuring that a single developer anywhere in the System is the only one who may modify an object. The Workstation is assigned when creating the object or when checking it out for update. The Workstation is removed when checking the object into the Master (Keep Locks is unchecked) or when specifically unlocking the object either in Visual LANSA or on the IBM i Master under Work With Tasks.
The use of System-wide Locks cannot be changed. There are no direct options in Visual LANSA to alter this behaviour.
Database-wide Locks
Database-wide Locks ensure the single update of the whole or some part of a particular database. The Workstation is also used to control this type of lock. Examples of Database-wide Locks are:
Database-wide Locks can be switched off. Refer to Object Locking for details.
Workstation-wide Locks
Workstation-wide Locks help a developer by ensuring that they do not hinder themselves. The lock is specific to a Workstation plus the Windows Process Identifier. For example:
Workstation-wide Locks can be switched off. Refer to Object Locking for details.
Independent System Differences
The System-wide Lock is not based on the Workstation. It's only the Task Id.
A single user, independent, workstation may choose to switch off Object locking, but be aware that the protections offered by Database-wide Locks and Workstation-wide Locks listed above will not be available.
The default for such as system is to set Object Locking to Off.
Also See