Locking and Unlocking Elements

In Software AG Designer, you can manage changes to elements during development by locking them. This prevents two different users from editing an element at the same time. You can lock elements such as flow services, Java services, schemas, and specifications.

All elements in Designer’s Package Navigator view are read-only until you lock them. You can edit an element only if you own the lock on the element. However, you can use and run a service regardless of its lock status, as long as you have Execute access to the service.

Local locking on Integration Server is the default locking mode of Integration Server and Designer.

Note: If you are using the local service development feature in Designer, the locking mode must be set to system. To do so, set the watt.server.ns.lockingMode parameter to system.

What Is a Lock?

A lock on an element prevents another user from editing that element. There are two types of locks: user locks and system locks. When an element is locked by you, you have a user lock. The element is read-only to all other users on the Integration Server. Another user cannot edit the element until you unlock it.

When an element’s supporting files (node.xml, for example) are marked read-only on the Integration Server, the element is system locked. For example, the server administrator has the ability to mark an element’s supporting files on the server as read-only, in which case they are system locked. To edit the element, you must ask the server administrator to remove the system lock (that is, make the element’s files writable), and then you must reload the package in which the element resides.

Elements are shown in the following ways in Designer’s Package Navigator:

Element Status Can I edit? How do I gain rights to edit?
Not locked No Right-click the element and then select Lock.
Locked by you Yes N/A
Locked by another user No Contact the user to unlock.
Locked by the system No Contact the server administrator to unlock.

About Locking Elements

Before you edit an element, you must lock it. Locking ensures that you are the only person working on a particular element at a time, preventing the loss of changes. Elements can only be locked by one user at a time. If the element you need is already locked, request that the current owner of the lock release it. If the element is system locked, request that the server administrator release it by making the corresponding server files writable.

Elements are locked by webMethods user name (the name you use to log on to the Integration Server). Because of this, it is important that you use a distinct user name to log on to the server. If you change user names, you will be unable to edit or unlock items that you locked using your old user name.

Locking Elements in Designer

About this task

When locking elements, keep the following points in mind:
  • When you create a new element, it is locked automatically for you.
  • In order to lock an element, you must have Write access rights to it. For details, see Assigning and Managing Permissions for Elements.
  • When you lock an element, Designer obtains and locks the latest version of the element that has been saved on the webMethods Integration Server.
  • Elements generated by a service (including an adapter service) are not locked automatically.
  • When you select multiple elements to lock, some elements in the selection may not be available to lock because they may be system locked, locked by another user, elements to which you do not have Write access, or elements that cannot directly be locked. Designer will notify you that these elements cannot be locked and will lock the rest.
  • When you lock an adapter notification, Designer also locks its associated publishable document type. You cannot directly lock the publishable document type associated with an adapter notification.
  • When you lock a folder or package, you only lock existing, unlocked elements within it. Other users can still create new elements in that folder or package.
  • When you lock a Java or C/C++ service, Designer locks all other Java or C/C++ services within the folder. This means that other users cannot create Java and C/C++ services in a folder or package that contains the Java or C/C++ services. To create these services, all existing Java and C/C++ services in the folder must be unlocked and the user must have Write access to all Java and C/C++ services in the folder. For details, see Guidelines for Locking Java and C/C++ Services.
  • You cannot lock a listener or connection element.

To lock an element

Procedure

  1. In the Package Navigator or in the editor, select the elements that you want to lock.
  2. Right-click the elements and then click Lock.

    If the elements were successfully locked, a green check mark appears next to their icons in Package Navigator view. If one or more of the elements could not be locked (for example, if they are system locked, locked by another user, or elements to which you do not have Write access), Designer displays a dialog box listing them. For information about troubleshooting lock problems, see Lock and Unlock Problems.

Guidelines for Locking Java and C/C++ Services

When you lock Java and C/C++ services, there are special considerations to keep in mind.

  • Locking and unlocking actions on Java and C/C++ services are folder-wide. All Java and C/C++ services in a folder share the same .java and .class files on the Integration Server. These files, located in the \code subdirectory of a package, correspond to all services (except flow services) in a folder. Therefore, when you lock a Java/C service, all Java/C services in that folder are locked.

    For example, if you lock a Java service in a folder A, all Java and C/C++ services in folder A are locked by you. Similarly, if another user has locked a Java service in folder B, you cannot add, edit, move, or delete any Java or C/C++ services in folder B.

  • Locking actions on Java and C/C++ services are ACL dependent. If you want to lock one or more Java or C/C++ services within a folder, you must have Write access to all Java and C/C++ services in that folder. This is because Java and C/C++ services within a folder share the same .java and .class files.
  • The jcode development environment operates independently of locking. If you use jcode to develop Java services, you do not have the locking functionality that is available in the Integration Server. When you use jcode, you may compile a service that is locked by another user, overwriting that user’s changes to the service. Therefore, if you use jcode, do not use the locking features in the Integration Server.
  • Before you save a Java or C/C++ service, multiple corresponding files must be writable on the server.A single Java or C/C++ service corresponds to the following files:

    .java
    .class
    .ndf
    .frag (may not be present)
  • Before you save a Java or C/C++ service, all of the preceding files must be writable. Therefore, make sure that all system locks are removed from those files before saving.

Guidelines for Locking Templates

A template can be used with one or more services on the Integration Server. Currently, you cannot lock a template as an entity, only the service to which it is attached. Following are considerations for working with templates in a cooperative development environment.

  • To create or edit a template for a service, you must have the service locked.
  • The template for a service can change without your knowledge. Since a template can be attached to one or more services, keep in mind that a shared template can change without your knowledge. For example, if your template is attached to a service that another user locks and edits, that user can change your template.

System Locking Elements

If you are a server administrator, you can system lock an element by using the server’s file system to make the element’s supporting server files read-only. If you do not know the names of the files that correspond to a particular element, use the Lock Properties command from the right-click menu. For details, see Viewing Lock Status of Elements. Usually, a system lock is not reflected in Software AG Designer or the Integration Server Administrator until you reload the package in which the element resides.

Important: Before you system lock an element, always verify that it is not locked by a user on the Integration Server. If an element becomes system locked while a user is editing it, the user will not know until he or she tries to save changes to the element. If this occurs, make the element’s corresponding files writable on the server. After this is done, the user can save his or her changes to the element.
Note: System locking is not supported if you are running webMethods Integration Server as root on a Unix system.

Viewing the Status of Locked Elements

The lock status of an element tells you whether an element is available for locking. If an element is locked, the lock status tells you who owns the lock and when they locked it.

When viewing an element’s lock status, keep the following points in mind:

  • If the element has been system locked since you last reloaded the package, Designer will not show the system lock status in the Lock Properties dialog box until you reload the package.

  • When another user unlocks an element, you must refresh the Package Navigator to reflect the updated status. Similarly, when the server administrator removes a system lock from an element, you must reload the package in which the element resides to reflect the updated status.

Viewing Lock Status of Elements

About this task

You can view the lock status of an element in Package Navigator view.

To view the lock status of an element

Procedure

In Package Navigator view, right-click the element for which you want to view the status, and then click Lock Properties.

The Lock Contents Results dialog box displays the following information about the locked element:

  • The person who owns the lock on the element.
  • The host on which the locked element resides.
  • The date the element was locked.
  • A list of server-side files that are part of the element.

Listing All of Your Locked Elements

About this task

You can view a list of all the elements that are locked by you in the Package Navigator view.

To list all of your locked elements

Procedure

  1. In Package Navigator view, select the server for which you want to view your locked elements.
  2. Click File > Properties > My Locked Elements.

    You can unlock individual elements from the My Locked Elements page by pressing the CTRL key as you click each element and then clicking Unlock. You can unlock all elements by clicking Unlock All. For more information about unlocking elements, see Unlocking Elements.

Copying, Moving, or Deleting Locked Elements

You can copy a locked element to another folder or package. However, you cannot move, rename, or delete an element unless it is locked by you or unlocked.

Unlocking Elements

After you edit an element and save changes to the server, you should unlock it to make it available to other users. There are several ways to unlock elements, depending on whether you are a member of the Developers ACL or the Administrators ACL. If you are a developer, you can unlock elements in Designer. If you are an administrator, you can unlock elements in the Integration Server Administrator as well as in Designer.

Unlocking Elements in Designer

About this task

You must explicitly unlock elements. Disconnecting from the server does not unlock your element(s), because locks are maintained from session to session.

When unlocking elements, keep the following points in mind:

  • Save changes to the elements before you attempt to unlock them.
  • When you unlock a single Java or C service, Designer unlocks all other Java or C services within the folder. For details, see Guidelines for Locking Java and C/C++ Services.
  • If a Java or C service in a folder has unsaved changes, you will not be able to unlock other Java or C services within that folder. Save the changes and then unlock the services.
  • When you unlock an adapter notification, Designer also unlocks its associated publishable document type. You cannot directly unlock the publishable document type associated with an adapter notification.
  • You cannot unlock a listener or connection element.

To unlock elements using Designer

Procedure

  1. In Package Navigator view, select the elements that you want to unlock.
  2. Right-click the elements and then select Unlock.
  3. If the elements you want to unlock contain unsaved changes, Designer alerts you that the elements cannot be unlocked until you save the changes. Click OK to close the alert dialog box. Then, save the changes and repeat the unlock action.
  4. If one of the elements you selected to unlock is a publishable document type associated with an adapter notification, and you did not also select the adapter notification, Designer alerts you that the elements cannot be unlocked. Click OK to close the alert dialog box. Then, reselect the elements (including the appropriate adapter notifications) and repeat the unlock action.

    Package Navigator view refreshes and the green check mark next to the element disappears.

Automatically Unlocking an Element Upon Saving

About this task

You can choose to automatically unlock flow services, IS document types, and specifications after you save changes to them. This prevents you from forgetting to unlock them; however, it may not be the best option if you save periodically while editing an element.

To automatically unlock elements after saving

Procedure

  1. In Designer: Window > Preferences
  2. In the preference navigation tree: Software AG > Service Development > Package Navigator
  3. Under Preferences, select the Automatically unlock upon save check box.
  4. Click Apply to save your changes. Or click OK to save your changes and close the Preferences dialog box.

Troubleshooting

This following sections address common problems that may arise when implementing cooperative development with webMethods components.

Lock and Unlock Problems

The Lock for Edit and Unlock commands are disabled.

Possible causes are:

  • The Integration Server to which you are connected may have the watt.server.ns.lockingMode property configured to “none” or “system.” For details, contact your server administrator.
  • You have selected multiple elements to lock or unlock and your selection contains of one or more of the following:
    • A server
    • A folder or package and its contents
    • A package and any other element
    • An adapter notification record
When I try to lock an element, I get an exception message.
The element may be locked by someone else, system-locked (marked read-only on the server), or you may not have Write access. Refresh the Package Navigator. If a lock is not shown but you still cannot lock the element, reload the package. In addition, make sure that you are a member of the ACL assigned for Write access to the element by checking the element’s Permissions property in the Properties view.
I cannot unlock a Java or C service.
If there is another Java or C service that is locked by another user or system locked in the same folder, then you cannot unlock any Java or C services in that folder. This is because those services share the same .java and .class files on the Integration Server.
I cannot unlock elements since I changed my user name.

You can only unlock elements that you have locked with your current user name for the session. If you have changed user names, log back in to the server with your old user name and then unlock the elements.

If the administrator has deleted your user name, contact him or her to unlock the elements on the server. You can assist the administrator by using the Lock Status command to identify the names of the system-locked files on the server that need to be unlocked.

Another user unlocked an element, but it still shows as locked in the Package Navigator view.
If it is a Java or C service, reload the package in the Package Navigator view. If it is any other element, use the Refresh command to refresh the Package Navigator.
I receive an “element failed to unlock” message when I try to unlock elements in the Integration Server Administrator.
This indicates that the server files for the locked element were deleted from the server. You need to update the Integration Server Administrator’s list of unlocked elements by clicking Sync to Name Space on the Packages >Management > Locked elements screen. The Sync to Name Space command runs automatically when the server is started or restarted.

Package Management Problems

I can’t preserve locking information when I replicate and publish a package.
This is expected behavior and is part of the feature’s design. You can, however, preserve system locks (read-only file attributes).
When I disable a package, it does not preserve locking information.
This is expected behavior and prevents conflicts if another package with the same folder and element names gets installed.

Save Problems

When I try to save an element that I have locked, I get an exception message.

During the time that you had the lock, the element became system-locked, its ACL status changed, or a server administrator removed your lock and another user locked the element. If the exception message indicates that a file is read-only, then one or all of the files that pertain to that element on the server are system-locked. Contact your administrator to remove the system lock. After this is done, you can save the element and your changes will be incorporated.

If the exception message indicates that you cannot perform the action without ACL privileges, then the ACL assigned to the element has been changed to an ACL in which you are not an Allowed user. To preserve your changes to the element, contact your server administrator to:

  1. Remove your lock on the element.
  2. Lock the element.
  3. Edit the ACL assigned for Write access to the element, to give you access.
  4. Unlock the element.

You can then save your changes to the element.

When I try to save a template, I get an error message.
The template file on the server is read-only. Contact your server administrator to make the file writable.

Other Problems

I can’t delete a package.
One of the elements in that package is system-locked (read-only) or locked by another user. Contact your administrator or contact the user who has the element locked in the package.
The webMethods Integration Server went down while I was locking or unlocking an element.
The action may or may not have completed, depending on the exact moment at which the server ceased action. When the server is back up, restore your session and look at the current status of the element.

Frequently Asked Questions

What is the difference between a system-locked element and a read-only element?
None. “System lock” is a term used to denote an element that has read-only files on the webMethods Integration Server. The server administrator usually applies system locks to files (makes them read-only).
Can I select multiple elements to lock or unlock in Package Navigator view simultaneously?

Yes, you can select multiple elements to lock or unlock in the Package Navigator view of Designer, as long as your selection does not contain the following:

  • A server
  • A folder or package and its contents
  • A package and any other element
  • An adapter notification record

You can also lock or unlock all elements in a package or folder that have not been previously locked/unlocked by right-clicking the package or folder and selecting Lock or Unlock.

Where is the lock information (such as names of elements that are locked, and when they were locked) stored?
If you are using local service development, lock information is stored in the VCS repository only.
Important: It is not recommended that you use locking and unlocking functionality in an Integration Server cluster. Locking information for elements could be inadvertently shared with another Integration Server in the cluster. Use a standalone Integration Server, not a cluster, during development to eliminate these issues.
Should I archive derived files?
Generally, you should not archive derived files such as the .class file that is generated when you compile a Java service.
What happens to the locks on elements when I replicate a package?
Locking information is not preserved when you replicate and publish a package. This is expected behavior and is part of the feature’s design. You can, however, preserve system locks (read-only file attributes).