lock

Locks the access to scheduling objects definitions in the database.

Authorization

To lock scheduling objects, you must have modify access to the object.

To lock security objects, you must have permission for the modify action on the object type file with attribute name=security.

Syntax

{lock | lo}
{[calendars | calendar | cal=[folder/]calname] |
[eventrule | erule | er=[folder/]eventrulename] |
[folder | fol=foldername] |
[parms | parm | vb=[[folder/]tablename.]variablename] |
[vartable | vt=[folder/]tablename] |
[prompts | prom=[folder/]promptname] |
[resources | resource | res=[[folder/]workstationame#][folder/]resourcename] |
[runcyclegroup | rcg=[folder/]runcyclegroupname] |
[cpu={[folder/]workstationame | [folder/]workstationclassname | domainame}]
[workstation | ws=[folder/]workstationame] |
[workstationclass | wscl=[folder/]workstationclassname] |
[domain | dom=domainame] |
[jobs | jobdefinition | jd=[[folder/]workstationame#][folder/]jobname] |
[sched|jobstream|js= [[folder/]workstationame#][folder/]jstreamname
   [valid from date|valid to date |valid in date date]
] |
[users | user=[[folder/]workstationame#]username] |
[accesscontrollist | acl for securitydomainname] |
[securitydomain | sdom=securitydomainname] |
[securityrole | srol=securityrolename]
}

Arguments

calendars
Locks all calendar definitions.
calendars | calendar | cal
If no argument follows, locks all calendar definitions.

If argument [folder/]calname follows, locks the calname calendar. Wildcard characters are permitted.

eventrule | erule | er
If no argument follows, locks all event rule definitions.

If argument [folder/]eventrulename follows, locks the eventrulename event rule. Wildcard characters are permitted.

folder
If no argument follows, locks the current folder.

If argument foldername follows, locks the foldername folder. If a parent folder is locked, a child folder can be modified or deleted. Wildcard characters are permitted.

parms | parm | vb
If no argument follows, locks the entire default variable table.
If argument [folder/]tablename.variablename follows, locks the entire table containing the variablename variable. If tablename is omitted, composer locks the entire default variable table.
Note: When you lock a variable, this locks the entire variable table that contains it. This implies that, while the table is locked, no other user can run any other locking commands on it.
Wildcard characters can be used on both tablename and variablename. For example:
lock parms=@.@
Locks all variables on all tables. As a result, all variable tables are locked.
lock parms=@
Locks all variables on the default table. As a result, the variable table is locked.
lock parms=@.acct@
Locks all the variables whose name starts with acct on all the existing tables. As a result, all the variable tables that contain at least one variable named in this way are locked.
vartable | vt
If no argument follows, locks all variable table definitions.

If argument [folder/]tablename variable table follows, locks the tablename variable table. Wildcard characters are permitted.

prompts | prom
If no argument follows, locks all prompt definitions.

If argument [folder/]promptname follows, locks the promptname prompt. Wildcard characters are permitted.

resources | resource | res
If no argument follows, locks all resource definitions.

If argument [folder/]workstationame#[folder/]resourcename follows, locks the resourcename resource of the workstationame workstation in the specified folder on which the resource is defined. If workstationame is omitted, the default is the workstation on which composer is running. Wildcard characters are permitted.

runcyclegroup | rcg
If no argument follows, locks all run cycle group definitions.

If argument [folder/]runcyclegroupname follows, locks the runcyclegroupname run cycle group. Wildcard characters are permitted.

cpu
Locks workstations, workstation classes, or domains.
[folder/]workstation
The name of the workstation. Wildcard characters are permitted.
[folder/]workstationclass
The name of the workstation class. Wildcard characters are permitted.
domain
The name of the domain. Wildcard characters are permitted.
workstation | ws
If no argument follows, locks all workstation definitions.

If argument [folder/]workstationname follows, locks the workstationname workstation. Wildcard characters are permitted.

domain | dom
If no argument follows, locks all domain definitions.

If argument domainname follows, locks the domainname domain. Wildcard characters are permitted.

workstationclass | wscl
If no argument follows, locks all workstation class definitions.

If argument [folder/]workstationclassname follows, locks the workstationclassname workstation class. Wildcard characters are permitted.

jobs | jobdefinition | jd
If no argument follows, locks all job definitions.

If argument [folder/]workstationame#[folder/]jobname follows, locks the jobname job of the workstationame workstation on which the job runs. If workstationame is omitted, the default is the workstation on which composer is running. Wildcard characters are permitted.

sched | jobstream | js
If no argument follows, locks all job stream definitions.
If argument [folder/]workstationame#[folder/]jstreamname follows, locks the jstreamname job stream of the workstationame workstation on which the job stream is defined. If workstationame is omitted, the default is the workstation on which composer is running. Wildcard characters are permitted.
valid from
date Restricts the selection to job streams that have a valid from date equal to the indicated value. The format is mm/dd/yyyy.
valid to
date Restricts the selection to job streams that have a valid to date equal to the indicated value. The format is mm/dd/yyyy.
valid in
date date The time frame during which the job stream can run. The format is mm/dd/yyyy - mm/dd/yyyy. One of the two dates can be represented by @.
users | user
If no argument follows, locks all user definitions.

If argument [folder/]workstationame#username follows, locks the username user of the workstationame workstation in the specified folder on which the user is defined. If workstationame is omitted, the default is the workstation on which composer is running. Wildcard characters are permitted.

accesscontrollist | acl
If no securitydomainname argument follows, locks the access control list definitions for all the security domains.

If argument securitydomainname follows, locks the access control list definitions for the securitydomainname security domain. Wildcard characters are permitted for securitydomainname .

securitydomain | sdom
If no securitydomainname argument follows, locks all the security domain definitions.

If argument securitydomainname follows, locks the definition of the securitydomainname security domain. Wildcard characters are permitted for securitydomainname .

securityrole | srol
If no securityrolename argument follows, locks all the security roles definitions.

If argument securityrolename follows, locks the definition of the securityrolename security role. Wildcard characters are permitted for securityrolename .

Comments

Objects are locked to make sure that definitions in the database are not overwritten by different users accessing concurrently to the same objects.

With this command the user explicitly acquires locks of database objects. When one user has an object locked, any other user has read only access until the object is released or explicitly unlocked by the administrator. If one user tries to lock an object that is already locked by someone else (other user), an error message is returned.

Locks on database objects are acquired by the user using username and session, where session is a string that can be set in the environment variable TWS_SESSION identifying that specific user work session.

This means that, on a machine, the TWS_SESSION identifier is different for:
  • a user connected in two different shells to the composer command line program.
  • a user connected, disconnected and then connected again to the composer command line from the same shell.
If no value is assigned to TWS_SESSION, then the default value identifying the session is set as follows:
  • If using composer in batch mode, the default value is the username used by the user when connecting to the master domain manager.
  • If using composer in interactive mode, the default value corresponds to an alphanumeric string automatically created by the product.
Note: In the database the username of the user locking an object definition is saved in uppercase.

Examples

To lock the calendar named Holidays, run the command:
lock calendar=HOLIDAYS
To lock a folder named Chicago, run the command:
lock folder /CHICAGO

See also

In the Dynamic Workload Console, objects are automatically locked as long as you or another user have them open using the Edit button. Objects are not locked if you or another user opened them with View.