ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/3] ignite git commit: ignite-1.5 Minor fix in JDBC POJO store.
Date Fri, 13 Nov 2015 07:26:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-1758-debug bd4c99719 -> 87621a989


ignite-1.5 Minor fix in JDBC POJO store.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5887ae4d
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5887ae4d
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5887ae4d

Branch: refs/heads/ignite-1758-debug
Commit: 5887ae4d7a318089bb8b19e56cbecc782be1ba76
Parents: 1f5a409
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Fri Nov 13 10:44:35 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Fri Nov 13 10:44:35 2015 +0700

----------------------------------------------------------------------
 .../store/jdbc/CacheAbstractJdbcStore.java      | 34 +++++++++++---------
 1 file changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5887ae4d/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
index 6e27b9a..6e19234 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java
@@ -354,22 +354,26 @@ public abstract class CacheAbstractJdbcStore<K, V> implements
CacheStore<K, V>,
         Transaction tx = ses.transaction();
 
         if (tx != null) {
-            Connection conn = ses.<String, Connection>properties().remove(ATTR_CONN_PROP);
+            Map<String, Connection> sesProps = ses.properties();
 
-            assert conn != null;
+            Connection conn = sesProps.get(ATTR_CONN_PROP);
 
-            try {
-                if (commit)
-                    conn.commit();
-                else
-                    conn.rollback();
-            }
-            catch (SQLException e) {
-                throw new CacheWriterException(
-                    "Failed to end transaction [xid=" + tx.xid() + ", commit=" + commit +
']', e);
-            }
-            finally {
-                U.closeQuiet(conn);
+            if (conn != null) {
+                sesProps.remove(ATTR_CONN_PROP);
+
+                try {
+                    if (commit)
+                        conn.commit();
+                    else
+                        conn.rollback();
+                }
+                catch (SQLException e) {
+                    throw new CacheWriterException(
+                            "Failed to end transaction [xid=" + tx.xid() + ", commit=" +
commit + ']', e);
+                }
+                finally {
+                    U.closeQuiet(conn);
+                }
             }
 
             if (log.isDebugEnabled())
@@ -1821,4 +1825,4 @@ public abstract class CacheAbstractJdbcStore<K, V> implements
CacheStore<K, V>,
             }
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message