[
https://issues.apache.org/jira/browse/OFBIZ-13395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18078618#comment-18078618
]
Deepak Dixit commented on OFBIZ-13395:
--------------------------------------
Enhance service semaphore to support parameter-based locking ([#1166
|https://github.com/apache/ofbiz-framework/pull/1166])
* Added {{semaphore-parameter-name}} attribute to service definitions
* Extended {{ServiceSemaphore}} to include {{parameterValue}}
* Updated locking logic to use {{(serviceName, parameterValue)}} scope
* Modified dispatcher to pass parameter values from service requests
* Allows concurrent execution of the same service for different parameter
values
* Enables finer-grained concurrency control compared to service-level locking
Please use the following SQL to update the service_semaphore table schema for
parameter-based locking support:
{code:java}
ALTER TABLE service_semaphore DROP PRIMARY KEY;
ALTER TABLE service_semaphore ADD PRIMARY KEY (service_name,
parameter_value);{code}
> Enhance ServiceSemaphore to support parameter-based semaphore locking
> ---------------------------------------------------------------------
>
> Key: OFBIZ-13395
> URL: https://issues.apache.org/jira/browse/OFBIZ-13395
> Project: OFBiz
> Issue Type: New Feature
> Reporter: Deepak Dixit
> Assignee: Deepak Dixit
> Priority: Minor
>
> Enhance the existing {{ServiceSemaphore}} mechanism to support locking based
> on selected service parameters, instead of locking only at the service level.
> Currently, if a service is protected by a semaphore, only one instance of
> that service can run at a time. However, in some cases the service should be
> allowed to run simultaneously when the execution context is different.
> For example:
> * Same service can run in parallel for different {{productStoreId}}
> * Same service can run in parallel for different {{facilityId}}
> * Same service should be blocked only when the configured semaphore
> parameters match
> This feature will make the semaphore framework more flexible and allow better
> parallel processing.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)