Fixed: Exception in service semaphore in wait mode and with multi

thread calls.
(OFBIZ-9534).

Thanks Pierre Gaudin for reporting and providing the patch.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Brohl
2017-10-07 10:23:02 +00:00
parent 80476aded7
commit 96601e4d22
@@ -129,7 +129,12 @@ public class ServiceSemaphore {
semaphore = delegator.makeValue("ServiceSemaphore", "serviceName", model.name, "lockedByInstanceId", JobManager.instanceId, "lockThread", threadName, "lockTime", lockTime);
// use the special method below so we can reuse the unqiue tx functions
dbWrite(semaphore, false);
try {
dbWrite(semaphore, false);
} catch (SemaphoreFailException e) {
// can't write a new semaphore, need to wait
return true;
}
// we own the lock, no waiting
return false;