Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2CEAF917F for ; Wed, 11 Apr 2012 22:00:56 +0000 (UTC) Received: (qmail 87678 invoked by uid 500); 11 Apr 2012 22:00:55 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 87644 invoked by uid 500); 11 Apr 2012 22:00:55 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 87636 invoked by uid 99); 11 Apr 2012 22:00:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2012 22:00:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Apr 2012 22:00:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 59D472388B3A; Wed, 11 Apr 2012 22:00:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1325035 - /camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java Date: Wed, 11 Apr 2012 22:00:32 -0000 To: commits@camel.apache.org From: cmueller@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120411220032.59D472388B3A@eris.apache.org> Author: cmueller Date: Wed Apr 11 22:00:31 2012 New Revision: 1325035 URL: http://svn.apache.org/viewvc?rev=1325035&view=rev Log: CAMEL-5161: If MyBatis experiences an error on commit (e.g. unique PK violation) it appears to hold the session open and cause DB writelock errors Modified: camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java Modified: camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java?rev=1325035&r1=1325034&r2=1325035&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java (original) +++ camel/branches/camel-2.9.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java Wed Apr 11 22:00:31 2012 @@ -121,8 +121,11 @@ public class MyBatisProducer extends Def doProcessResult(exchange, result); } } finally { - session.commit(); - session.close(); + try { + session.commit(); + } finally { + session.close(); + } } } @@ -147,8 +150,11 @@ public class MyBatisProducer extends Def doProcessResult(exchange, result); } } finally { - session.commit(); - session.close(); + try { + session.commit(); + } finally { + session.close(); + } } } @@ -173,8 +179,11 @@ public class MyBatisProducer extends Def doProcessResult(exchange, result); } } finally { - session.commit(); - session.close(); + try { + session.commit(); + } finally { + session.close(); + } } }