Return-Path: X-Original-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 562719580 for ; Thu, 16 May 2013 17:09:16 +0000 (UTC) Received: (qmail 75749 invoked by uid 500); 16 May 2013 17:09:16 -0000 Delivered-To: apmail-incubator-ambari-dev-archive@incubator.apache.org Received: (qmail 75730 invoked by uid 500); 16 May 2013 17:09:16 -0000 Mailing-List: contact ambari-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-dev@incubator.apache.org Received: (qmail 75720 invoked by uid 99); 16 May 2013 17:09:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 May 2013 17:09:16 +0000 Date: Thu, 16 May 2013 17:09:16 +0000 (UTC) From: "Siddharth Wagle (JIRA)" To: ambari-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AMBARI-2142) Unecessary use of @Transactional on all DAO methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Siddharth Wagle created AMBARI-2142: --------------------------------------- Summary: 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