# IGNITE-32: Fixes on 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/e24622ef Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e24622ef Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e24622ef Branch: refs/heads/ignite-6 Commit: e24622ef9e8eb195c6eb192cb21f9b2829b5f453 Parents: 27c09c2 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Mon Feb 2 21:35:16 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Mon Feb 2 21:35:16 2015 +0700 ---------------------------------------------------------------------- .../ignite/cache/query/CacheQueryTypeMetadata.java | 1 + .../apache/ignite/cache/store/jdbc/JdbcCacheStore.java | 12 +++++++----- .../ignite/cache/store/jdbc/JdbcPojoCacheStore.java | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e24622ef/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java index 775fde9..e866f19 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/query/CacheQueryTypeMetadata.java @@ -33,6 +33,7 @@ public class CacheQueryTypeMetadata { /** Type name, e.g. class name. */ private String valType; + // TODO MOVE to cache or store config ? /** Database table metadata.*/ private CacheQueryTableMetadata tblMeta; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e24622ef/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 71acce1..9d66aaf 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 @@ -445,8 +445,8 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements G EntryMapping em = cacheMappings(cacheName).get(keyTypeId); if (em == null) - throw new CacheException("Failed to find mapping description for key: " + key + - " in cache: " + (cacheName != null ? cacheName : "<default>")); + throw new CacheException("Failed to find mapping description for key: " + key + " in cache: " + + (cacheName != null ? cacheName : "<default>")); return em; } @@ -757,7 +757,8 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements G } else for (Cache.Entry<? extends K, ? extends V> e : entries) - write(e); + write(e); // TODO rework to optimal usage. Method write will get all params each time (conn, stmt). + // split into 2 methods writeMerge + writeUpsert. } /** {@inheritDoc} */ @@ -807,9 +808,10 @@ public abstract class JdbcCacheStore<K, V> extends CacheStore<K, V> implements G for (int rowCount : rowCounts) if (rowCount != 1) { + // TODO stmtType used 2 times? + // TODO print warning for all keys. + // TODO while failed - convert collection to array and print warnins to each failed key. log.warning("Batch " + stmtType + " returned unexpected row count from " + stmtType + " statement"); - - break; } } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e24622ef/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java index fef7001..e6d0f3a 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/JdbcPojoCacheStore.java @@ -57,7 +57,6 @@ public class JdbcPojoCacheStore extends JdbcCacheStore<Object, Object> { * @param fields Fields. */ public PojoMethodsCache(String clsName, Collection<CacheQueryTableColumnMetadata> fields) throws CacheException { - try { cls = Class.forName(clsName);