ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siddharth Wagle (JIRA)" <>
Subject [jira] [Updated] (AMBARI-2142) Unecessary use of @Transactional on all DAO methods
Date Thu, 16 May 2013 17:13:18 GMT


Siddharth Wagle updated AMBARI-2142:

    Fix Version/s:     (was: 1.3.0)
> Unecessary use of @Transactional on all DAO methods
> ---------------------------------------------------
>                 Key: AMBARI-2142
>                 URL:
>             Project: Ambari
>          Issue Type: Bug
>          Components: controller
>    Affects Versions: 1.2.4
>            Reporter: Siddharth Wagle
>            Assignee: Siddharth Wagle
>             Fix For: 1.2.4
>         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 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:

View raw message