aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java10
-rw-r--r--dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java2
-rwxr-xr-xsli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java7
3 files changed, 9 insertions, 10 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
index 047fa297..85acd272 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
@@ -83,6 +83,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
protected final long expectedCompletionTime;
protected final long unprocessedFailoverThreshold;
private static final String LOGGER_ALARM_MSG="Generated alarm: DBResourceManager.getData - No active DB connection pools are available.";
+ private static final String EXCEPTION_MSG= "No active DB connection pools are available in RequestDataNoRecovery call.";
public DBResourceManager(final DBLIBResourceProvider configuration) {
this(configuration.getProperties());
@@ -461,7 +462,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
private CachedRowSet requestDataNoRecovery(String statement, ArrayList<Object> arguments, String preferredDS) throws SQLException {
if(dsQueue.isEmpty()){
LOGGER.error(LOGGER_ALARM_MSG);
- throw new DBLibException("No active DB connection pools are available in RequestDataNoRecovery call.");
+ throw new DBLibException(EXCEPTION_MSG);
}
CachedDataSource active = this.dsQueue.first();
long time = System.currentTimeMillis();
@@ -475,8 +476,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
}
}
return active.getData(statement, arguments);
-// } catch(SQLDataException exc){
-// throw exc;
+
} catch(Throwable exc){
String message = exc.getMessage();
if(message == null)
@@ -537,7 +537,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
private boolean writeDataNoRecovery(String statement, ArrayList<Object> arguments, String preferredDS) throws SQLException {
if(dsQueue.isEmpty()){
LOGGER.error(LOGGER_ALARM_MSG);
- throw new DBLibException("No active DB connection pools are available in RequestDataNoRecovery call.");
+ throw new DBLibException(EXCEPTION_MSG);
}
boolean initialRequest = true;
@@ -665,7 +665,7 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
SQLException exception = new DBLibException(lastException.getMessage());
exception.setStackTrace(lastException.getStackTrace());
if(lastException.getCause() instanceof SQLException) {
-// exception.setNextException((SQLException)lastException.getCause());
+
throw (SQLException)lastException.getCause();
}
throw exception;
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
index 905944b1..454af02b 100644
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/pm/PollingWorker.java
@@ -62,7 +62,7 @@ public class PollingWorker implements Runnable {
interval = Long.parseLong((ctxprops == null || ctxprops.getProperty("org.onap.ccsdk.dblib.pm.interval") == null)
? "60" : (String) ctxprops.getProperty("org.onap.ccsdk.dblib.pm.interval"));
// '0' bucket is to count exceptions
- String sampling[] = ((ctxprops == null || ctxprops.getProperty("org.onap.ccsdk.dblib.pm.sampling") == null)
+ String[] sampling = ((ctxprops == null || ctxprops.getProperty("org.onap.ccsdk.dblib.pm.sampling") == null)
? "0,2,5,10,20,50,100" : (String) ctxprops.getProperty("org.onap.ccsdk.dblib.pm.sampling")).split(",");
if (enabled) {
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
index b4059ed2..d5c7f3bf 100755
--- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
+++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java
@@ -3,7 +3,7 @@
* ONAP : CCSDK
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights
- * reserved.
+ * reserved.
* ================================================================================
* Modifications Copyright (C) 2018 IBM.
* ================================================================================
@@ -27,7 +27,6 @@ import java.util.Properties;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
import org.onap.ccsdk.sli.core.sli.ConfigurationException;
-import org.onap.ccsdk.sli.core.sli.MetricLogger;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicDblibStore;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -44,7 +43,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
-public class SvcLogicServiceImpl extends SvcLogicServiceImplBase implements SvcLogicService {
+public class SvcLogicServiceImpl extends SvcLogicServiceImplBase implements SvcLogicService {
private static final Logger LOG = LoggerFactory.getLogger(SvcLogicServiceImpl.class);
protected BundleContext bctx = null;
@@ -113,7 +112,7 @@ public class SvcLogicServiceImpl extends SvcLogicServiceImplBase implements SvcL
execute(graph, ctx);
return (ctx.toProperties());
}
-
+
@Override
public SvcLogicStore getStore() throws SvcLogicException {
// Create and initialize SvcLogicStore object - used to access