camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject svn commit: r1182244 - /camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
Date Wed, 12 Oct 2011 07:47:48 GMT
Author: jbonofre
Date: Wed Oct 12 07:47:47 2011
New Revision: 1182244

URL: http://svn.apache.org/viewvc?rev=1182244&view=rev
Log:
[CAMEL-4533] Check if connection is not null before rollback to avoid NPE

Modified:
    camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java

Modified: camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java?rev=1182244&r1=1182243&r2=1182244&view=diff
==============================================================================
--- camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
(original)
+++ camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
Wed Oct 12 07:47:47 2011
@@ -98,7 +98,8 @@ public class JdbcProducer extends Defaul
             conn.commit();
         } catch (Exception e) {
             try {
-                conn.rollback();
+                if (conn != null)
+                    conn.rollback();
             } catch (SQLException sqle) {
                 LOG.warn("Error on jdbc component rollback: " + sqle, sqle);
             }



Mime
View raw message