Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

LockGoneException: Save, Delete or Commit has failed

SA-71542

Summary



An application is conrigured with a Connect-Rest. For a connection failure, an exception is raised from a Utility activity and the ConnectionProblem flow is executed. The assignment has an SLA associated. However, the LockGoneException occurs occasionally.


Error Messages



[PegaRULES-Batch-1] [STANDARD] [ ] [an_app:01.01.01] (ExecuteSLA.Assign_.Action) ERROR - obj-save failed. 
com.pega.pegarules.pub.database.LockGoneException: Save, Delete or Commit has failed because lock "abc-123" is not held 
at com.pega.pegarules.data.internal.access.Saver.checkRequiredLock(Saver.java:1202) ~[prprivate.jar:?] 
at com.pega.pegarules.data.internal.access.Saver.saveDeferred(Saver.java:420) ~[prprivate.jar:?] 
at com.pega.pegarules.data.internal.access.DatabaseImpl.saveDeferred(DatabaseImpl.java:2735) ~[prprivate.jar:?] 
at com.pega.pegarules.data.internal.access.DatabaseImpl.saveDeferred(DatabaseImpl.java:2719) ~[prprivate.jar:?] 
at com.pegarules.generated.activity.ra_action_executesla_fa2882d547e5bde96b62307aa1df4293.step23_circum0(ra_action_executesla_fa2882d547e5bde96b62307aa1df4293.java:2524) ~[?:?] 
at com.pegarules.generated.activity.ra_action_executesla_fa2882d547e5bde96b62307aa1df4293.perform(ra_action_executesla_fa2882d547e5bde96b62307aa1df4293.java:515) ~[?:?] 
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3597) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:10845) ~[prprivate.jar:?] 
at com.pegarules.generated.activity.ra_action_processevent_13dbf998333209fe57f14c113f3419d2.step7_circum0(ra_action_processevent_13dbf998333209fe57f14c113f3419d2.java:724) ~[?:?] 
at com.pegarules.generated.activity.ra_action_processevent_13dbf998333209fe57f14c113f3419d2.perform(ra_action_processevent_13dbf998333209fe57f14c113f3419d2.java:199) ~[?:?] 
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3597) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:786) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:655) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:1055) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1327) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1075) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:957) ~[prprivate.jar:?] 
at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:761) ~[prprivate.jar:?] 
at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:991) ~[prjsr166java6-3.0.jar:?] 
at com.pega.jsr166backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:532) ~[prjsr166java6-3.0.jar:?] 
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_74]


Steps to Reproduce

  1. Configure an assignment level SLA.
  2. Wait till the Goal and Deadline is reached such that the corresponding escalation activities are executed.


Root Cause



In the application, a Commit step was included in an activity. This caused the lock from being held. Additionally, a node level data page was configured with one hour reload policy.


Resolution



Perform the following local-change:

Instead of using Commit step, apply additional logic to isolate the Update, Save, and Commit operations in a separate transaction:
  1. In the Java step add the below code to start a new transaction:

    ((PegaDatabase)tools.getThread().getDatabase()).setCurrentTransaction("<Name_Of_Transaction>"); TransactionStarted = true;

  2. Perform the Updates, Save, and Commit the changes.
  3. Add the below code to end the transaction.

    try{ ((PegaDatabase)tools.getThread().getDatabase()). assertTransactionComplete(); TransactionStarted = false; }catch(Exception e){
    }

In Pega 8.1, a similar implementation is found in the pzSaveObject activity.






 

Published January 23, 2019 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice