Repository: incubator-ignite Updated Branches: refs/heads/ignite-32 bff48f9cc -> 91e34767a
# IGNITE-32 Added update count check. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/91e34767 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/91e34767 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/91e34767 Branch: refs/heads/ignite-32 Commit: 91e34767a5ce64928e719aa66967b8c3c7fd1384 Parents: bff48f9 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Wed Feb 4 14:12:01 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Wed Feb 4 14:12:01 2015 +0700 ---------------------------------------------------------------------- .../org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/91e34767/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java index 47cc212..ae5a50a 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcCacheStore.java @@ -652,7 +652,6 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L // The error with code 23505 is thrown when trying to insert a row that // would violate a unique index or primary key. - // TODO check with all RDBMS if (sqlState != null && Integer.valueOf(sqlState) == 23505) { if (we == null) we = new CacheWriterException("Failed insert entry in database, violate a unique" + @@ -712,7 +711,11 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L fillValueParameters(stmt, i, em, entry.getValue()); - stmt.executeUpdate(); + int updCnt = stmt.executeUpdate(); + + if (updCnt != 1) + U.warn(log, "Unexpected number of updated entries [table=" + em.fullTableName() + + ", key=" + key + "expected=1, actual=" + updCnt + "]"); } finally { U.closeQuiet(stmt);