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:
+6
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user