SailPoint Coding Best Practices_Pragma Insights 010319

SailPoint Object Locking: Best Practices

As per best practices from SailPoint’s coding of rules and workflow, you should lock an object from within your rule/script, while performing an update. Doing so will help to maintain ACID property DB

Here is a code snippet to properly lock and unlock an object by using the transaction locking mechanism.

The example is for a Custom object, but can be used for any sailpoint.object that extends SailPointObject.

For an Identity object and other objects (Certification) that should use the persistent locking mechanism, refer to the lockIdentity, lockCertificationById methods in the ObjectUtil class.

import sailpoint.api.ObjectUtil;

import sailpoint.object.Custom;

//Get the Transaction lock

Custom custom = ObjectUtil.transactionLock(context, Custom.class, custObjName);

try {

//Modify the object

custom.put(key, val);

//Save the modifications in the Try block


} catch (Exception e) {

//Log any errors encountered during saving the object


} finally {

//Commit the transaction





This article is contributed by Roopesh. Roopesh is our Senior Consultant and has over 8 years of experience in Identity and Access Management (IAM), particularly with SailPoint and CyberArk.


March 1, 2019

How can we work together?

Get in touch.