[
https://issues.apache.org/jira/browse/OFBIZ-5619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975221#comment-13975221 ]
Simone Viani commented on OFBIZ-5619:
-------------------------------------
Hi Jacopo,
in ServiceDispatcher, requireNewTransaction depends on useTransaction,
so if you set the first in the cloned model, you should also set the second
on it, but not in the ModelService copy constructor which is unaware of
the caller purpose.
Indeed the issue is when you don't want transaction at all, for example:
- service1 doesn't use transaction and calls service2.
- service2 doesn't use transaction and takes 70 secs to execute.
A direct call to service2 succeeds without a transaction.
A call to service1 fails because of a timeout in the implicit transaction for service2.
> Minilang call-service always use transaction
> --------------------------------------------
>
> Key: OFBIZ-5619
> URL:
https://issues.apache.org/jira/browse/OFBIZ-5619> Project: OFBiz
> Issue Type: Bug
> Components: framework
> Affects Versions: SVN trunk
> Reporter: Simone Viani
> Assignee: Jacopo Cappellato
> Attachments: OFBIZ-5619.patch
>
>
> Minilang call-service, and some of the runSync, always use transaction, even if the called service is defined to not use it.
> {code:title=GenericDispatcherFactory.java}
> public Map<String, Object> runSync(String serviceName, Map<String, ? extends Object> context, int transactionTimeout, boolean requireNewTransaction) throws ServiceAuthException, ServiceValidationException, GenericServiceException {
> // ...
> ModelService cloned = new ModelService(service);
> // ...
> }
> {code}
> {code:title=ModelService.java}
> public boolean useTransaction;
> // ...
> public ModelService(ModelService model) {
> // ...
> this.useTransaction = model.useTransaction || true;
> // ...
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)