You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by se...@apache.org on 2015/03/02 15:04:26 UTC

[37/50] [abbrv] incubator-ignite git commit: # sprint-2 - fixing comments.

# sprint-2 - fixing comments.


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

Branch: refs/heads/ignite-sql-tests
Commit: 3a77acf759cd30bbb7bdcb51ab8e1bcecb273639
Parents: 16105ec
Author: Dmitiry Setrakyan <ds...@gridgain.com>
Authored: Sat Feb 28 09:49:15 2015 -0800
Committer: Dmitiry Setrakyan <ds...@gridgain.com>
Committed: Sat Feb 28 09:49:15 2015 -0800

----------------------------------------------------------------------
 .../ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/3a77acf7/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
index 0473280..55ba1a7 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/jdbc/CacheJdbcPersonStore.java
@@ -131,7 +131,8 @@ public class CacheJdbcPersonStore extends CacheStoreAdapter<Long, Person> {
 
             int updated;
 
-            // Try update first.
+            // Try update first. If it does not work, then try insert.
+            // Some databases would allow these to be done in one 'upsert' operation.
             try (PreparedStatement st = conn.prepareStatement(
                 "update PERSONS set firstName=?, lastName=? where id=?")) {
                 st.setString(1, val.getFirstName());