aboutsummaryrefslogtreecommitdiffstats
path: root/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
diff options
context:
space:
mode:
Diffstat (limited to 'dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java')
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
index e5eff24a..02cce3cf 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/CachedDataSource.java
@@ -47,7 +47,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
* Change Log
* Author Date Comments
* ============== ======== ====================================================
@@ -68,7 +68,7 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito
protected long dataReqTimeout = 100L;
private final SQLExecutionMonitor monitor;
- protected DataSource ds = null;
+ protected final DataSource ds;
protected String connectionName = null;
protected boolean initialized = false;
@@ -85,7 +85,7 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito
private boolean isDerby = false;
public CachedDataSource(BaseDBConfiguration jdbcElem) throws DBConfigException {
- configure(jdbcElem);
+ ds = configure(jdbcElem);
if ("org.apache.derby.jdbc.EmbeddedDriver".equals(jdbcElem.getDriverName())) {
isDerby = true;
@@ -93,7 +93,7 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito
monitor = new SQLExecutionMonitor(this);
}
- protected abstract void configure(BaseDBConfiguration jdbcElem) throws DBConfigException;
+ protected abstract DataSource configure(BaseDBConfiguration jdbcElem) throws DBConfigException;
/*
* (non-Javadoc)
@@ -329,7 +329,6 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito
LOGGER.warn(e.getMessage());
}
}
- ds = null;
monitor.deleteObservers();
monitor.cleanup();
}
@@ -389,16 +388,6 @@ public abstract class CachedDataSource implements DataSource, SQLExecutionMonito
return null;
}
- @SuppressWarnings("deprecation")
- public void setConnectionCachingEnabled(boolean state) {
- // if(ds != null && ds instanceof OracleDataSource)
- // try {
- // ((OracleDataSource)ds).setConnectionCachingEnabled(true);
- // } catch (SQLException exc) {
- // LOGGER.warn("", exc);
- // }
- }
-
public void addObserver(Observer observer) {
monitor.addObserver(observer);
}