# IGNITE-32 Fixed typo and chanhes after review.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/666ad8b0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/666ad8b0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/666ad8b0 Branch: refs/heads/sprint-1 Commit: 666ad8b0dfc856d89366d8b4cc4f3b786924a52f Parents: 91e3476 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Wed Feb 4 14:32:16 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Wed Feb 4 14:32:16 2015 +0700 ---------------------------------------------------------------------- .../ignite/cache/store/jdbc/JdbcCacheStore.java | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/666ad8b0/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 ae5a50a..5537965 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 @@ -385,7 +385,6 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L /** * @return Type mappings for specified cache name. - * * @throws CacheException If failed to initialize. */ private Map<Object, EntryMapping> cacheMappings(@Nullable String cacheName) throws CacheException { @@ -540,7 +539,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L EntryMapping em = entryMapping(keyTypeId(key), key); if (log.isDebugEnabled()) - log.debug("Start load value from database [table= " + em.fullTableName()+ ", key=" + key + "]"); + log.debug("Start load value from database [table= " + em.fullTableName() + ", key=" + key + "]"); Connection conn = null; @@ -623,19 +622,19 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L CacheWriterException we = null; for (int attempt = 0; attempt < MAX_ATTEMPT_WRITE_COUNT; attempt++) { - int i = fillValueParameters(updStmt, 1, em, entry.getValue()); + int paramIdx = fillValueParameters(updStmt, 1, em, entry.getValue()); - fillKeyParameters(updStmt, i, em, entry.getKey()); + fillKeyParameters(updStmt, paramIdx, em, entry.getKey()); if (updStmt.executeUpdate() == 0) { - i = fillKeyParameters(insStmt, em, entry.getKey()); + paramIdx = fillKeyParameters(insStmt, em, entry.getKey()); - fillValueParameters(insStmt, i, em, entry.getValue()); + fillValueParameters(insStmt, paramIdx, em, entry.getValue()); try { insStmt.executeUpdate(); - if (i > 0) + if (attempt > 0) U.warn(log, "Entry was inserted in database on second try [table=" + em.fullTableName() + ", entry=" + entry + "]"); } @@ -670,7 +669,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L } } - if (i > 0) + if (attempt > 0) U.warn(log, "Entry was updated in database on second try [table=" + em.fullTableName() + ", entry=" + entry + "]"); @@ -715,7 +714,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L if (updCnt != 1) U.warn(log, "Unexpected number of updated entries [table=" + em.fullTableName() + - ", key=" + key + "expected=1, actual=" + updCnt + "]"); + ", entry=" + entry + "expected=1, actual=" + updCnt + "]"); } finally { U.closeQuiet(stmt); @@ -909,7 +908,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L int numOfRowCnt = rowCounts.length; if (numOfRowCnt != prepared) - U.warn(log, "Unexpected number of updated rows [table=" + em.fullTableName() +", expected=" + prepared + + U.warn(log, "Unexpected number of updated rows [table=" + em.fullTableName() + ", expected=" + prepared + ", actual=" + numOfRowCnt + "]"); for (int i = 0; i < numOfRowCnt; i++) { @@ -933,7 +932,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L try { conn = connection(); - Object currKeyTypeId = null; + Object currKeyTypeId = null; EntryMapping em = null; @@ -1270,6 +1269,7 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements L return dialect.loadQuery(typeMeta.getDatabaseSchema(), typeMeta.getDatabaseTable(), keyCols, cols, keyCnt); } + /** * Construct query for select values in range. *