camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1325038 - /camel/branches/camel-2.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java
Date Wed, 11 Apr 2012 22:03:32 GMT
Author: cmueller
Date: Wed Apr 11 22:03:32 2012
New Revision: 1325038

URL: http://svn.apache.org/viewvc?rev=1325038&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.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java

Modified: camel/branches/camel-2.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java?rev=1325038&r1=1325037&r2=1325038&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java
(original)
+++ camel/branches/camel-2.8.x/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisProducer.java
Wed Apr 11 22:03:32 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();                
+            }
         }
     }
 



Mime
View raw message