Fix merge issues
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d67038b9 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d67038b9 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d67038b9 Branch: refs/heads/tomee-1.7.x Commit: d67038b961c16979c2fe845855d40806cf89e374 Parents: e1b4987 Author: Jonathan Gallimore <[email protected]> Authored: Thu Aug 11 17:48:28 2016 +0100 Committer: Jonathan Gallimore <[email protected]> Committed: Thu Aug 11 17:48:28 2016 +0100 ---------------------------------------------------------------------- .../openejb/assembler/classic/Assembler.java | 2 -- .../resource/jdbc/DataSourceFactory.java | 2 +- .../jdbc/FlushableDataSourceHandler.java | 20 ++++++++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/d67038b9/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java index dad28ac..e1a33b2 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java @@ -180,8 +180,6 @@ import javax.resource.spi.ResourceAdapter; import javax.resource.spi.ResourceAdapterInternalException; import javax.resource.spi.XATerminator; import javax.resource.spi.work.WorkManager; -import javax.servlet.ServletContext; -import javax.sql.CommonDataSource; import javax.sql.DataSource; import javax.transaction.TransactionManager; import javax.transaction.TransactionSynchronizationRegistry; http://git-wip-us.apache.org/repos/asf/tomee/blob/d67038b9/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java index 514e505..d88e52d 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/DataSourceFactory.java @@ -101,7 +101,7 @@ public class DataSourceFactory { flushConfig = new FlushableDataSourceHandler.FlushConfig( name, configuredManaged, impl, PropertiesHelper.propertiesToString(properties), - maxWaitTime, timeBetweenEvictionRuns, minEvictableIdleTime); + maxWaitTime, timeBetweenEvictionRuns, minEvictableIdleTime, useAlternativeDriver); } else { flushConfig = null; } http://git-wip-us.apache.org/repos/asf/tomee/blob/d67038b9/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/FlushableDataSourceHandler.java ---------------------------------------------------------------------- diff --git a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/FlushableDataSourceHandler.java b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/FlushableDataSourceHandler.java index 5b974ed..993b271 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/FlushableDataSourceHandler.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/FlushableDataSourceHandler.java @@ -20,6 +20,7 @@ import org.apache.openejb.util.Duration; import org.apache.openejb.util.LogCategory; import org.apache.openejb.util.Logger; +import javax.sql.CommonDataSource; import java.io.Flushable; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; @@ -27,7 +28,6 @@ import java.lang.reflect.Method; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import javax.sql.CommonDataSource; public class FlushableDataSourceHandler implements InvocationHandler { private static final Logger LOGGER = Logger.getInstance(LogCategory.OPENEJB, FlushableDataSourceHandler.class); @@ -44,7 +44,16 @@ public class FlushableDataSourceHandler implements InvocationHandler { private void createANewDelegate() { final CommonDataSource old = delegate; try { - this.delegate = DataSourceFactory.create(config.name, config.configuredManaged, config.impl, config.definition, config.maxWaitTime, config.timeBetweenEvictionRuns, config.minEvictableIdleTime); + this.delegate = DataSourceFactory.create( + config.name, + config.configuredManaged, + config.impl, + config.definition, + config.maxWaitTime, + config.timeBetweenEvictionRuns, + config.minEvictableIdleTime, + config.useAlternativeDriver); + } catch (final Exception e) { LOGGER.error("Can't recreate the datasource, keeping old one", e); this.delegate = old; @@ -104,8 +113,10 @@ public class FlushableDataSourceHandler implements InvocationHandler { public final Duration maxWaitTime; public final Duration timeBetweenEvictionRuns; public final Duration minEvictableIdleTime; + private final boolean useAlternativeDriver; - public FlushConfig(final String name, final boolean configuredManaged, final Class impl, final String definition, final Duration maxWaitTime, final Duration timeBetweenEvictionRuns, final Duration minEvictableIdleTime) { + public FlushConfig(final String name, final boolean configuredManaged, final Class impl, final String definition, final Duration maxWaitTime, final Duration timeBetweenEvictionRuns, final Duration minEvictableIdleTime, + final boolean useAlternativeDriver) { this.name = name; this.impl = impl; this.configuredManaged = configuredManaged; @@ -113,6 +124,7 @@ public class FlushableDataSourceHandler implements InvocationHandler { this.maxWaitTime = maxWaitTime; this.timeBetweenEvictionRuns = timeBetweenEvictionRuns; this.minEvictableIdleTime = minEvictableIdleTime; + this.useAlternativeDriver = useAlternativeDriver; } } -} \ No newline at end of file +}
