[ 
https://issues.apache.org/jira/browse/AMBARI-2142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siddharth Wagle updated AMBARI-2142:
------------------------------------

    Attachment: AMBARI-2142.patch
    
> Unecessary use of @Transactional on all DAO methods
> ---------------------------------------------------
>
>                 Key: AMBARI-2142
>                 URL: https://issues.apache.org/jira/browse/AMBARI-2142
>             Project: Ambari
>          Issue Type: Bug
>          Components: controller
>    Affects Versions: 1.3.0
>            Reporter: Siddharth Wagle
>            Assignee: Siddharth Wagle
>             Fix For: 1.3.0
>
>         Attachments: AMBARI-2142.patch
>
>
> Most of the DAO objects in Ambari are annotated with @Transactional.  (see 
> org.apache.ambari.server.orm.dao.HostRoleCommandDAO).
> {quote}
>  Any method or class marked with this annotation will be considered for 
> transactionality. Consult the documentation on 
> http://code.google.com/p/google-guice for detailed semantics. Marking a 
> method @Transactional will start a new transaction before the method executes 
> and commit it after the method returns.
> If the method throws an exception, the transaction will be rolled back unless 
> you have specifically requested not to in the #ignore() clause.
> Similarly, the set of exceptions that will trigger a rollback can be defined 
> in the #rollbackOn() clause. By default, only unchecked exceptions trigger a 
> rollback.
> {quote}
> I think that marking simple getter methods as transactional may be 
> introducing unnecessary overhead.  I don't think that a non-mutating method 
> that does not require read consistency needs to be marked transactional.
> Profiling a service start on a 200 node cluster shows that about 1/3 of the 
> time is spent in almost 3000 JDBC commit() and over 1400 setAutoCommit() 
> calls. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to