[ 
https://issues.apache.org/jira/browse/OFBIZ-4282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037656#comment-13037656
 ] 

David E. Jones commented on OFBIZ-4282:
---------------------------------------

*** For #1: 

I did a little more research, and it looks like you're right Philippe, the 
synchronized is no longer needed. It was there originally because before JTA 
1.1 the setTransactionTimeout method was defined like this:

"Modify the timeout value that is associated with transactions started by 
subsequent invocations of the begin method."

In JTA 1.1 the definition was changed to fix just this issue and now reads like 
this:

"Modify the timeout value that is associated with transactions started by 
subsequent invocations of the begin method by the current thread."

As long as the JTA implementation used follows this rule, then leaving the 
method unsynchronized should be fine.

*** For #2:

I didn't say I'm against a configurable setting, like a properties file 
setting. I said I'm against changing the default in the code for all of OFBiz 
without making it configurable.

On the topic of configuration: I'm against business-level configuration in 
properties files (that should go in the DB), I'm not against technical or 
system configuration in properties files, in fact that's just where it belongs.


> TransactionUtil performance optimisations
> -----------------------------------------
>
>                 Key: OFBIZ-4282
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4282
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Philippe Mouawad
>              Labels: PERFORMANCE
>         Attachments: patch-OFBIZ-4282.patch
>
>
> Hello,
> Reviewing TransactionUtil code, I have seen 2 problems:
> - internalBegin is uselessly synchronized , since it is a static method it is 
> a very big useless Contention Point since not unthread safe instance variable 
> is used 
> - debugResources is true which creates a DebugXAResource (that creates an 
> Exception) , it should be false and made an option for debuging
> These 2 modifications have been in our production for a while and we noticed 
> CPU reduction and no more contention on TransactionUtil#begin
> Regards
> Philippe Mouawad
> http://www.ubik-ingenierie.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to