Could not acquire lock

Could not acquire lock

book

Article ID: KB0075794

calendar_today

Updated On:

Products Versions
TIBCO EBX All supported versions.

Description

When several procedures are executed simultaneously, the performances of the application can be degraded and such a message will appear in the logs:

2017-11-01 13:49:21,078 CDT WARN   log.kernel 1054:0002 [http-bio-8080-exec-19] Could not acquire lock [id=167] because CfHome[branch "DataSpaceRef" in cache #5c0de4a6]@5a13d9e3 is currently locked by unit of work: UowCfProcedure[MassUpdateOccurrencesProcedure]@746c41dc by thread: http-bio-8080-exec-12.

Issue/Introduction

Could not acquire lock

Resolution

This message indicates that the thread [http-bio-8080-exec-12]  is currently executing a procedure MassUpdateOccurrencesProcedure on the dataspace DataSpaceRef.

Due to the isolation mechanism of procedures, the thread [http-bio-8080-exec-19] has to wait for the procedure to end in order to be able to start its own procedure execution.

Please refer to the Procedure java documentation:

Isolation
The execution of a procedure prevents the concurrent execution of another procedure on the same dataspace or snapshot. However, it does not prevent concurrent reads (outside of procedures, or in a ReadOnlyProcedure). See also Concurrency and isolation levels.

In order to avoid such performances issues, procedures that are supposed to take a long execution time need to be executed on a dedicated dataspace or snapshot.

If you have a procedure that takes 10 minutes to execute, I will create a new dataspace that contain the data on which I want to execute my procedure and then execute my procedure on this dataspace.

Such a dataspace creation can be hidden to the user using a custom user service or a workflow script task for example.

Additional Information

https://docs.tibco.com/pub/ebx/5.9.8/doc/html/en/Java_API/com/orchestranetworks/service/Procedure.html