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

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

Philippe: did you consider the down-sides to these changes? It's fine if you 
want to make these changes locally, but consider undesirable behavior if they 
were the default:

1. If internalBegin is not synchronized the timeout for a transaction would 
bleed over into other transactions; unfortunately this is a major weakness with 
the JTA API: you can only change timeout for the entire transaction manager, 
you can't set it for a single transaction.

2. If the debug stack is not maintained it makes it harder to track down 
transaction and various database-related issues, even in production. If you 
haven't found it to be useful, then again, it's fine to change locally but it 
is valuable information to have when tracking down bad code or certain 
lower-level problems. Also, have you done performance measurements with and 
without to see how much of a change there is?

About the synchronization problem, that is a significant performance issue that 
I have seen while working with clients. However, the real cause of the problem 
is higher up because by default all screens are run within a transaction, and 
really it's pretty rare that a screen needs to be run in a transaction, so that 
is where a change should be made.

Either way, performance "improvements" without metrics and tracking down the 
main cause of problems is likely to produce as many problems as it solves.

Based on that, I'd say these changes should NOT be committed.

> 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