You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2018/01/02 19:21:11 UTC

[geode] branch feature/GEODE-4009 updated (a78a904 -> ac7ddc3)

This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a change to branch feature/GEODE-4009
in repository https://gitbox.apache.org/repos/asf/geode.git.


    from a78a904  renamed ConnectionManager to DataSourceManager introduced JdbcDataSourceFactory to all unit tests to tell DataSourceManager how to create a data source.
     new 571edf6  removed unused imports
     new ac7ddc3  read now checks if jdbc connection and mapping exist

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jdbc/internal/DataSourceManager.java           |  2 --
 .../geode/connectors/jdbc/internal/SqlHandler.java | 25 +++++++++++-----------
 2 files changed, 13 insertions(+), 14 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].

[geode] 01/02: removed unused imports

Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch feature/GEODE-4009
in repository https://gitbox.apache.org/repos/asf/geode.git

commit 571edf673ac8f81fb8f4f475e84ca03600f70604
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Tue Jan 2 11:19:36 2018 -0800

    removed unused imports
---
 .../org/apache/geode/connectors/jdbc/internal/DataSourceManager.java    | 2 --
 1 file changed, 2 deletions(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java
index 1d66cf6..0f062b2 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/DataSourceManager.java
@@ -14,8 +14,6 @@
  */
 package org.apache.geode.connectors.jdbc.internal;
 
-import java.sql.Connection;
-import java.sql.SQLException;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <co...@geode.apache.org>.

[geode] 02/02: read now checks if jdbc connection and mapping exist

Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch feature/GEODE-4009
in repository https://gitbox.apache.org/repos/asf/geode.git

commit ac7ddc3a34f46927810fad51b064a6cb36c9f6ee
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Tue Jan 2 11:20:38 2018 -0800

    read now checks if jdbc connection and mapping exist
---
 .../geode/connectors/jdbc/internal/SqlHandler.java | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java
index 8479217..b728226 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/SqlHandler.java
@@ -86,11 +86,22 @@ public class SqlHandler {
   }
 
   private RegionMapping getMappingForRegion(String regionName) {
-    return this.configService.getMappingForRegion(regionName);
+    RegionMapping regionMapping = this.configService.getMappingForRegion(regionName);
+    if (regionMapping == null) {
+      throw new IllegalStateException("JDBC mapping for region " + regionName
+          + " not found. Create the mapping with the gfsh command 'create jdbc-mapping'.");
+    }
+    return regionMapping;
   }
 
   private ConnectionConfiguration getConnectionConfig(String connectionConfigName) {
-    return this.configService.getConnectionConfig(connectionConfigName);
+    ConnectionConfiguration connectionConfig =
+        this.configService.getConnectionConfig(connectionConfigName);
+    if (connectionConfig == null) {
+      throw new IllegalStateException("JDBC connection with name " + connectionConfigName
+          + " not found. Create the connection with the gfsh command 'create jdbc-connection'");
+    }
+    return connectionConfig;
   }
 
   private String getKeyColumnName(Connection connection, String tableName) {
@@ -160,18 +171,8 @@ public class SqlHandler {
       throw new IllegalArgumentException("PdxInstance cannot be null for non-destroy operations");
     }
     RegionMapping regionMapping = getMappingForRegion(region.getName());
-    if (regionMapping == null) {
-      throw new IllegalStateException(
-          "JDBC write failed. JDBC mapping for region " + region.getFullPath()
-              + " not found. Create the mapping with the gfsh command 'create jdbc-mapping'.");
-    }
     ConnectionConfiguration connectionConfig =
         getConnectionConfig(regionMapping.getConnectionConfigName());
-    if (connectionConfig == null) {
-      throw new IllegalStateException(
-          "JDBC write failed. JDBC connection with name " + regionMapping.getConnectionConfigName()
-              + " not found. Create the connection with the gfsh command 'create jdbc-connection'");
-    }
 
     String tableName = regionMapping.getRegionToTableName();
     int pdxTypeId = value == null ? 0 : ((PdxInstanceImpl) value).getPdxType().getTypeId();

-- 
To stop receiving notification emails like this one, please contact
"commits@geode.apache.org" <co...@geode.apache.org>.