diff --git a/gradle.properties b/gradle.properties index dce6d2d..875d071 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = org.xbib name = database -version = 1.4.0 +version = 1.4.1 org.gradle.warning.mode = ALL diff --git a/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/Pool.java b/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/Pool.java index 0f984a4..2abe27e 100644 --- a/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/Pool.java +++ b/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/Pool.java @@ -940,7 +940,7 @@ public class Pool implements BagStateListener { } if (writeMethod == null) { logger.log(Level.SEVERE, "property does not exist on target: " + propName + " " + target.getClass()); - throw new RuntimeException(String.format("property %s does not exist on target %s", propName, target.getClass())); + return; } try { Class paramClass = writeMethod.getParameterTypes()[0]; @@ -965,7 +965,6 @@ public class Pool implements BagStateListener { } catch (Exception e) { logger.log(Level.WARNING, () -> MessageFormat.format("failed to set property {0} on target {1}", propName, target.getClass())); - throw new RuntimeException(e); } } diff --git a/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/util/DriverDataSource.java b/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/util/DriverDataSource.java index a85c86c..31ddb91 100644 --- a/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/util/DriverDataSource.java +++ b/jdbc-connection-pool/src/main/java/org/xbib/jdbc/connection/pool/util/DriverDataSource.java @@ -21,6 +21,8 @@ public class DriverDataSource implements DataSource { private static final String USER = "user"; + private static final String AUTOCOMMIT = "autocommit"; + private String jdbcUrl; private final Properties driverProperties; @@ -108,6 +110,13 @@ public class DriverDataSource implements DataSource { driverProperties.put(PASSWORD, driverProperties.getProperty("password", password)); } + public void setAutocommit(boolean enabled) { + String value = driverProperties.getProperty("autocommit", String.valueOf(enabled)); + driverProperties.put(AUTOCOMMIT, value); + // Oracle + driverProperties.put("oracle.jdbc.autoCommitSpecCompliant", value); + } + @Override public Connection getConnection(final String username, final String password) throws SQLException { final Properties cloned = (Properties) driverProperties.clone();