Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-09-16 16:32:48 -0400
committerRyan D. Brooks2010-09-16 16:32:48 -0400
commitf0f991b4f728f2e7550016da91eb2e8d2c8c750c (patch)
tree7ad402016cbf8810f6f6ffe43c3a7dccab95f402 /plugins/org.eclipse.osee.framework.database
parent445b78e7fdb5067609dd91f8b348ea91313ecedc (diff)
downloadorg.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.tar.gz
org.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.tar.xz
org.eclipse.osee-f0f991b4f728f2e7550016da91eb2e8d2c8c750c.zip
refactor: Utilize utility method OseeExceptions.wrapAndThrow instead of in-place code
Diffstat (limited to 'plugins/org.eclipse.osee.framework.database')
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java16
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ConnectionHandler.java41
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java8
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeSequence.java35
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java66
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java11
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java18
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java16
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeSql.java4
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java26
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java18
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionImpl.java34
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java34
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java29
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java37
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java157
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StaleConnectionCloser.java4
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java6
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java3
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java4
20 files changed, 295 insertions, 272 deletions
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
index 500102f6b0..736cba49a3 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/IOseeDatabaseService.java
@@ -33,21 +33,21 @@ public interface IOseeDatabaseService {
IOseeStatement getStatement(int resultSetType, int resultSetConcurrency) throws OseeDataStoreException;
- OseeConnection getConnection() throws OseeDataStoreException;
+ OseeConnection getConnection() throws OseeCoreException;
- OseeConnection getConnection(IDatabaseInfo info) throws OseeDataStoreException;
+ OseeConnection getConnection(IDatabaseInfo info) throws OseeCoreException;
- <O extends Object> int runBatchUpdate(String query, List<O[]> dataList) throws OseeDataStoreException;
+ <O extends Object> int runBatchUpdate(String query, List<O[]> dataList) throws OseeCoreException;
- <O extends Object> int runPreparedUpdate(String query, O... data) throws OseeDataStoreException;
+ <O extends Object> int runPreparedUpdate(String query, O... data) throws OseeCoreException;
- <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeDataStoreException;
+ <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeCoreException;
- <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeDataStoreException;
+ <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException;
- <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeDataStoreException;
+ <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeCoreException;
- <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeDataStoreException;
+ <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeCoreException;
boolean isProduction() throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ConnectionHandler.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ConnectionHandler.java
index 30875a2695..2c122d64d7 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ConnectionHandler.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ConnectionHandler.java
@@ -16,6 +16,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import org.eclipse.osee.framework.core.data.IDatabaseInfo;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.internal.Activator;
@@ -38,14 +39,14 @@ public final class ConnectionHandler {
/**
* Avoid using if possible
*/
- public static OseeConnection getConnection() throws OseeDataStoreException {
+ public static OseeConnection getConnection() throws OseeCoreException {
return getDatabase().getConnection();
}
/**
* Avoid using if possible
*/
- public static OseeConnection getConnection(IDatabaseInfo info) throws OseeDataStoreException {
+ public static OseeConnection getConnection(IDatabaseInfo info) throws OseeCoreException {
return getDatabase().getConnection(info);
}
@@ -66,7 +67,7 @@ public final class ConnectionHandler {
*
* @return number of records updated
*/
- public static <O extends Object> int runPreparedUpdate(String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runPreparedUpdate(String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedUpdate(query, data);
}
@@ -75,7 +76,7 @@ public final class ConnectionHandler {
*
* @return number of records updated
*/
- public static <O extends Object> int runBatchUpdate(String query, List<O[]> dataList) throws OseeDataStoreException {
+ public static <O extends Object> int runBatchUpdate(String query, List<O[]> dataList) throws OseeCoreException {
return getDatabase().runBatchUpdate(query, dataList);
}
@@ -84,31 +85,31 @@ public final class ConnectionHandler {
*
* @return number of records updated
*/
- public static <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedUpdate(connection, query, data);
}
- public static <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeDataStoreException {
+ public static <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeCoreException {
return getDatabase().runBatchUpdate(connection, query, dataList);
}
- public static <O extends Object> int runPreparedQueryFetchInt(int defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runPreparedQueryFetchInt(int defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(defaultValue, query, data);
}
- public static <O extends Object> int runPreparedQueryFetchInt(OseeConnection connection, int defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runPreparedQueryFetchInt(OseeConnection connection, int defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(connection, defaultValue, query, data);
}
- public static <O extends Object> int runCallableStatementFetchInt(String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runCallableStatementFetchInt(String query, O... data) throws OseeCoreException {
return runCallableStatementFetchInt(getStatement(), query, data);
}
- public static <O extends Object> int runCallableStatementFetchInt(OseeConnection connection, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runCallableStatementFetchInt(OseeConnection connection, String query, O... data) throws OseeCoreException {
return runCallableStatementFetchInt(getStatement(connection), query, data);
}
- public static <O extends Object> int runCallableStatementFetchInt(IOseeStatement chStmt, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> int runCallableStatementFetchInt(IOseeStatement chStmt, String query, O... data) throws OseeCoreException {
try {
chStmt.runCallableStatement(query, data);
return chStmt.getCallableInt(1);
@@ -117,15 +118,15 @@ public final class ConnectionHandler {
}
}
- public static <O extends Object> double runCallableStatementFetchDouble(String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> double runCallableStatementFetchDouble(String query, O... data) throws OseeCoreException {
return runCallableStatementFetchDouble(getStatement(), query, data);
}
- public static <O extends Object> double runCallableStatementFetchDouble(OseeConnection connection, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> double runCallableStatementFetchDouble(OseeConnection connection, String query, O... data) throws OseeCoreException {
return runCallableStatementFetchDouble(getStatement(connection), query, data);
}
- private static <O extends Object> double runCallableStatementFetchDouble(IOseeStatement chStmt, String query, O... data) throws OseeDataStoreException {
+ private static <O extends Object> double runCallableStatementFetchDouble(IOseeStatement chStmt, String query, O... data) throws OseeCoreException {
try {
chStmt.runCallableStatement(query, data);
return chStmt.getCallableDouble(1);
@@ -134,26 +135,26 @@ public final class ConnectionHandler {
}
}
- public static <O extends Object> long runPreparedQueryFetchLong(long defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> long runPreparedQueryFetchLong(long defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(defaultValue, query, data);
}
- public static <O extends Object> long runPreparedQueryFetchLong(OseeConnection connection, long defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> long runPreparedQueryFetchLong(OseeConnection connection, long defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(connection, defaultValue, query, data);
}
- public static <O extends Object> String runPreparedQueryFetchString(String defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> String runPreparedQueryFetchString(String defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(defaultValue, query, data);
}
- public static <O extends Object> String runPreparedQueryFetchString(OseeConnection connection, String defaultValue, String query, O... data) throws OseeDataStoreException {
+ public static <O extends Object> String runPreparedQueryFetchString(OseeConnection connection, String defaultValue, String query, O... data) throws OseeCoreException {
return getDatabase().runPreparedQueryFetchObject(connection, defaultValue, query, data);
}
/**
* Cause constraint checking to be deferred until the end of the current transaction.
*/
- public static void deferConstraintChecking(OseeConnection connection) throws OseeDataStoreException {
+ public static void deferConstraintChecking(OseeConnection connection) throws OseeCoreException {
if (SupportedDatabase.getDatabaseType(connection.getMetaData()) == SupportedDatabase.derby) {
return;
}
@@ -161,7 +162,7 @@ public final class ConnectionHandler {
runPreparedUpdate(connection, "SET CONSTRAINTS ALL DEFERRED");
}
- public static DatabaseMetaData getMetaData() throws OseeDataStoreException {
+ public static DatabaseMetaData getMetaData() throws OseeCoreException {
OseeConnection connection = getDatabase().getConnection();
try {
return connection.getMetaData();
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java
index 21114b012a..c45d67b352 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseTransactions.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.database.core;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeWrappedException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.internal.Activator;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -40,11 +40,7 @@ public final class DatabaseTransactions {
connection.commit();
OseeLog.log(Activator.class, Level.FINEST, String.format("End Transaction: [%s]", dbWork.getName()));
} catch (Exception ex) {
- if (ex instanceof OseeCoreException) {
- saveException = (OseeCoreException) ex;
- } else {
- saveException = new OseeWrappedException(ex);
- }
+ saveException = OseeExceptions.wrap(ex);
try {
connection.rollback();
connection.destroy();
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeSequence.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeSequence.java
index 235ebe1ebd..71a8088d95 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeSequence.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeSequence.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.database.core;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
/**
@@ -34,39 +35,39 @@ public interface IOseeSequence {
static final String IMPORT_MAPPED_INDEX_SEQ = "SKYNET_IMPORT_MAPPED_INDEX_SEQ";
static final String TTE_SESSION_SEQ = "TTE_SESSION_SEQ";
- long getNextSequence(String sequenceName) throws OseeDataStoreException;
+ long getNextSequence(String sequenceName) throws OseeCoreException;
- int getNextSessionId() throws OseeDataStoreException;
+ int getNextSessionId() throws OseeCoreException;
- int getNextTransactionId() throws OseeDataStoreException;
+ int getNextTransactionId() throws OseeCoreException;
- int getNextArtifactId() throws OseeDataStoreException;
+ int getNextArtifactId() throws OseeCoreException;
- int getNextOseeEnumTypeId() throws OseeDataStoreException;
+ int getNextOseeEnumTypeId() throws OseeCoreException;
- int getNextGammaId() throws OseeDataStoreException;
+ int getNextGammaId() throws OseeCoreException;
- int getNextArtifactTypeId() throws OseeDataStoreException;
+ int getNextArtifactTypeId() throws OseeCoreException;
- int getNextAttributeBaseTypeId() throws OseeDataStoreException;
+ int getNextAttributeBaseTypeId() throws OseeCoreException;
- int getNextAttributeProviderTypeId() throws OseeDataStoreException;
+ int getNextAttributeProviderTypeId() throws OseeCoreException;
- int getNextAttributeId() throws OseeDataStoreException;
+ int getNextAttributeId() throws OseeCoreException;
- int getNextAttributeTypeId() throws OseeDataStoreException;
+ int getNextAttributeTypeId() throws OseeCoreException;
- int getNextFactoryId() throws OseeDataStoreException;
+ int getNextFactoryId() throws OseeCoreException;
- int getNextBranchId() throws OseeDataStoreException;
+ int getNextBranchId() throws OseeCoreException;
- int getNextRelationTypeId() throws OseeDataStoreException;
+ int getNextRelationTypeId() throws OseeCoreException;
- int getNextRelationId() throws OseeDataStoreException;
+ int getNextRelationId() throws OseeCoreException;
- int getNextImportId() throws OseeDataStoreException;
+ int getNextImportId() throws OseeCoreException;
- int getNextImportMappedIndexId() throws OseeDataStoreException;
+ int getNextImportMappedIndexId() throws OseeCoreException;
void clear() throws OseeDataStoreException;
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java
index 116bc4c219..87ed7ffa5c 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IOseeStatement.java
@@ -16,7 +16,7 @@ import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
/**
* @author Jeff C. Phillips
@@ -24,21 +24,21 @@ import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
*/
public interface IOseeStatement extends Closeable {
- void runPreparedQuery(String query, Object... data) throws OseeDataStoreException;
+ void runPreparedQuery(String query, Object... data) throws OseeCoreException;
/**
* @param fetchSize hint as to the number of rows that should be fetched from the database at a time. will be limited
* to 10,000
*/
- void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeDataStoreException;
+ void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeCoreException;
/**
* Invokes a stored procedure parameters of type SQL3DataType are registered as Out parameters and all others are set
* as in parameters
*/
- void runCallableStatement(String query, Object... data) throws OseeDataStoreException;
+ void runCallableStatement(String query, Object... data) throws OseeCoreException;
- boolean next() throws OseeDataStoreException;
+ boolean next() throws OseeCoreException;
/**
* The application must call close when it is done using this object; however, it is safe to use this same object
@@ -47,39 +47,39 @@ public interface IOseeStatement extends Closeable {
@Override
void close();
- InputStream getBinaryStream(String columnName) throws OseeDataStoreException;
+ InputStream getBinaryStream(String columnName) throws OseeCoreException;
- InputStream getAsciiStream(String columnName) throws OseeDataStoreException;
+ InputStream getAsciiStream(String columnName) throws OseeCoreException;
- String getString(String columnName) throws OseeDataStoreException;
+ String getString(String columnName) throws OseeCoreException;
- float getFloat(String columnName) throws OseeDataStoreException;
+ float getFloat(String columnName) throws OseeCoreException;
- long getLong(String columnName) throws OseeDataStoreException;
+ long getLong(String columnName) throws OseeCoreException;
- int getInt(String columnName) throws OseeDataStoreException;
+ int getInt(String columnName) throws OseeCoreException;
- Timestamp getTimestamp(String columnName) throws OseeDataStoreException;
+ Timestamp getTimestamp(String columnName) throws OseeCoreException;
- BigDecimal getBigDecimal(String name) throws OseeDataStoreException;
+ BigDecimal getBigDecimal(String name) throws OseeCoreException;
- Time getTime(String name) throws OseeDataStoreException;
+ Time getTime(String name) throws OseeCoreException;
- double getDouble(String columnName) throws OseeDataStoreException;
+ double getDouble(String columnName) throws OseeCoreException;
- Date getDate(String columnName) throws OseeDataStoreException;
+ Date getDate(String columnName) throws OseeCoreException;
- boolean wasNull() throws OseeDataStoreException;
+ boolean wasNull() throws OseeCoreException;
- int getColumnCount() throws OseeDataStoreException;
+ int getColumnCount() throws OseeCoreException;
- String getColumnName(int columnIndex) throws OseeDataStoreException;
+ String getColumnName(int columnIndex) throws OseeCoreException;
- int getColumnType(int columnIndex) throws OseeDataStoreException;
+ int getColumnType(int columnIndex) throws OseeCoreException;
- String getColumnTypeName(int columnIndex) throws OseeDataStoreException;
+ String getColumnTypeName(int columnIndex) throws OseeCoreException;
- Object getObject(int columnIndex) throws OseeDataStoreException;
+ Object getObject(int columnIndex) throws OseeCoreException;
/**
* Returns the number of rows in the result set. Once this method returns the result set will be pointing to the last
@@ -87,34 +87,34 @@ public interface IOseeStatement extends Closeable {
*
* @return the number of rows in the result set
*/
- int getRowCount() throws OseeDataStoreException;
+ int getRowCount() throws OseeCoreException;
- boolean isNullable(int columnIndex) throws OseeDataStoreException;
+ boolean isNullable(int columnIndex) throws OseeCoreException;
- double getCallableDouble(int columnIndex) throws OseeDataStoreException;
+ double getCallableDouble(int columnIndex) throws OseeCoreException;
/**
* should not be used by application code because it is less readable than using the column name
*/
- int getInt(int columnIndex) throws OseeDataStoreException;
+ int getInt(int columnIndex) throws OseeCoreException;
- int getCallableInt(int columnIndex) throws OseeDataStoreException;
+ int getCallableInt(int columnIndex) throws OseeCoreException;
/**
* should not be used by application code because it is less readable than using the column name
*/
- long getLong(int columnIndex) throws OseeDataStoreException;
+ long getLong(int columnIndex) throws OseeCoreException;
/**
* should not be used by application code because it is less readable than using the column name
*/
- String getString(int columnIndex) throws OseeDataStoreException;
+ String getString(int columnIndex) throws OseeCoreException;
- String getComplementSql() throws OseeDataStoreException;
+ String getComplementSql() throws OseeCoreException;
- boolean isDatabaseType(SupportedDatabase type) throws OseeDataStoreException;
+ boolean isDatabaseType(SupportedDatabase type) throws OseeCoreException;
- void updateObject(String columnName, Object value) throws OseeDataStoreException;
+ void updateObject(String columnName, Object value) throws OseeCoreException;
- void updateRow() throws OseeDataStoreException;
+ void updateRow() throws OseeCoreException;
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
index 47bfec91e9..fcd76f707c 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
@@ -16,6 +16,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.internal.Activator;
@@ -121,7 +122,7 @@ public class JoinUtility {
return new CharJoinQuery(sessionId);
}
- public static List<Integer> getAllTagQueueQueryIds() throws OseeDataStoreException {
+ public static List<Integer> getAllTagQueueQueryIds() throws OseeCoreException {
List<Integer> queryIds = new ArrayList<Integer>();
IOseeStatement chStmt = ConnectionHandler.getStatement();
try {
@@ -172,7 +173,7 @@ public class JoinUtility {
}
@SuppressWarnings("unchecked")
- public void store(OseeConnection connection) throws OseeDataStoreException {
+ public void store(OseeConnection connection) throws OseeCoreException {
if (this.wasStored != true) {
List<Object[]> data = new ArrayList<Object[]>();
for (IJoinRow joinArray : entries) {
@@ -191,7 +192,7 @@ public class JoinUtility {
}
}
- public int delete(OseeConnection connection) throws OseeDataStoreException {
+ public int delete(OseeConnection connection) throws OseeCoreException {
int updated = 0;
IOseeDatabaseService databaseService = Activator.getInstance().getOseeDatabaseService();
if (queryId != -1) {
@@ -203,11 +204,11 @@ public class JoinUtility {
return updated;
}
- public void store() throws OseeDataStoreException {
+ public void store() throws OseeCoreException {
store(null);
}
- public int delete() throws OseeDataStoreException {
+ public int delete() throws OseeCoreException {
return delete(null);
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java
index da00695b41..db9d74d072 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeConnection.java
@@ -13,30 +13,26 @@ package org.eclipse.osee.framework.database.core;
import java.io.Closeable;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
public abstract class OseeConnection implements Closeable {
- protected OseeConnection() {
-
- }
-
@Override
public abstract void close();
- public abstract boolean isClosed() throws OseeDataStoreException;
+ public abstract boolean isClosed() throws OseeCoreException;
public abstract boolean isStale();
- public abstract DatabaseMetaData getMetaData() throws OseeDataStoreException;
+ public abstract DatabaseMetaData getMetaData() throws OseeCoreException;
- protected abstract void setAutoCommit(boolean autoCommit) throws OseeDataStoreException;
+ protected abstract void setAutoCommit(boolean autoCommit) throws OseeCoreException;
- protected abstract boolean getAutoCommit() throws SQLException;
+ protected abstract boolean getAutoCommit() throws OseeCoreException;
protected abstract void commit() throws SQLException;
- protected abstract void rollback() throws OseeDataStoreException;
+ protected abstract void rollback() throws OseeCoreException;
- protected abstract void destroy() throws OseeDataStoreException;
+ protected abstract void destroy() throws OseeCoreException;
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
index e267f04608..2894930306 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeInfo.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.database.core;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
@@ -30,13 +30,13 @@ public class OseeInfo {
private static Map<String, String> cache = new HashMap<String, String>();
- public static String getValue(String key) throws OseeDataStoreException {
+ public static String getValue(String key) throws OseeCoreException {
String toReturn = ConnectionHandler.runPreparedQueryFetchString("", GET_VALUE_SQL, key);
cache.put(key, toReturn);
return toReturn;
}
- public static String getCachedValue(String key) throws OseeDataStoreException {
+ public static String getCachedValue(String key) throws OseeCoreException {
String cacheValue = cache.get(key);
if (cacheValue == null) {
cacheValue = getValue(key);
@@ -53,7 +53,7 @@ public class OseeInfo {
* Note: This call will hit the database every time, so shouldn't be used for often repeated calls. use
* isCacheEnabled that will cache the value
*/
- public static boolean isEnabled(String key) throws OseeDataStoreException {
+ public static boolean isEnabled(String key) throws OseeCoreException {
String dbProperty = OseeInfo.getValue(key);
if (Strings.isValid(dbProperty)) {
return dbProperty.equals("true");
@@ -67,7 +67,7 @@ public class OseeInfo {
* <br>
* Return cached value (value only loaded once per session. Restart will reset value if changed in osee_info
*/
- public static boolean isCacheEnabled(String key) throws OseeDataStoreException {
+ public static boolean isCacheEnabled(String key) throws OseeCoreException {
String dbProperty = OseeInfo.getCachedValue(key);
if (Strings.isValid(dbProperty)) {
return dbProperty.equals("true");
@@ -75,17 +75,17 @@ public class OseeInfo {
return false;
}
- public static void setEnabled(String key, boolean enabled) throws OseeDataStoreException {
+ public static void setEnabled(String key, boolean enabled) throws OseeCoreException {
putValue(key, String.valueOf(enabled));
}
- public static void putValue(String key, String value) throws OseeDataStoreException {
+ public static void putValue(String key, String value) throws OseeCoreException {
ConnectionHandler.runPreparedUpdate(DELETE_KEY_SQL, key);
ConnectionHandler.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value);
cache.put(key, value);
}
- public static String getDatabaseGuid() throws OseeDataStoreException {
+ public static String getDatabaseGuid() throws OseeCoreException {
return getValue(DB_ID_KEY);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeSql.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeSql.java
index a6d334a03e..3b075a5b7d 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeSql.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/OseeSql.java
@@ -15,7 +15,7 @@ import java.util.Properties;
import org.eclipse.osee.framework.core.enums.ConflictStatus;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
/**
* @author Ryan D. Brooks
@@ -79,7 +79,7 @@ public enum OseeSql {
this(sql, null);
}
- public static Properties getSqlProperties(DatabaseMetaData metaData) throws OseeDataStoreException {
+ public static Properties getSqlProperties(DatabaseMetaData metaData) throws OseeCoreException {
Properties sqlProperties = new Properties();
boolean areHintsSupported = SupportedDatabase.areHintsSupported(metaData);
for (OseeSql oseeSql : OseeSql.values()) {
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java
index 0e9de71c90..50300bd698 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ResultSetProcessor.java
@@ -15,7 +15,8 @@ import java.io.InputStream;
import java.sql.Date;
import java.sql.Timestamp;
import java.sql.Types;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.IVariantData;
import org.eclipse.osee.framework.jdk.core.type.VariantData;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -25,7 +26,7 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
* @author Roberto E. Escobar
*/
public class ResultSetProcessor {
- public static IVariantData parse(IOseeStatement chStmt) throws OseeDataStoreException {
+ public static IVariantData parse(IOseeStatement chStmt) throws OseeCoreException {
IVariantData toReturn = new VariantData();
int numberOfColumns = chStmt.getColumnCount() + 1;
for (int index = 1; index < numberOfColumns; index++) {
@@ -57,33 +58,24 @@ public class ResultSetProcessor {
}
break;
default:
- try {
- String value = chStmt.getString(name);
- if (Strings.isValid(value) != false) {
- value = value.trim();
- }
- toReturn.put(upperCasedName, chStmt.getString(name));
- } catch (OseeDataStoreException ex) {
- String typeName = chStmt.getColumnTypeName(columnIndex);
- throw new OseeDataStoreException(getErrorMessage(name, typeName), ex);
+ String value = chStmt.getString(name);
+ if (Strings.isValid(value) != false) {
+ value = value.trim();
}
+ toReturn.put(upperCasedName, chStmt.getString(name));
break;
}
}
return toReturn;
}
- private static String getErrorMessage(String name, String typeName) {
- return String.format("Unable to convert [%s] of raw type [%s] to string.", name, typeName);
- }
-
- private static byte[] streamToByteArray(InputStream inputStream) throws OseeDataStoreException {
+ private static byte[] streamToByteArray(InputStream inputStream) throws OseeCoreException {
byte[] toReturn = new byte[0];
if (inputStream != null) {
try {
toReturn = Lib.inputStreamToBytes(inputStream);
} catch (IOException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
return toReturn;
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
index 01ac8e432a..a44632029f 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SupportedDatabase.java
@@ -12,7 +12,9 @@ package org.eclipse.osee.framework.database.core;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
public enum SupportedDatabase {
oracle,
@@ -21,9 +23,9 @@ public enum SupportedDatabase {
mysql,
postgresql;
- public static SupportedDatabase getDatabaseType(DatabaseMetaData metaData) throws OseeDataStoreException {
+ public static SupportedDatabase getDatabaseType(DatabaseMetaData metaData) throws OseeCoreException {
+ SupportedDatabase toReturn = null;
try {
- SupportedDatabase toReturn = null;
String dbName = metaData.getDatabaseProductName();
String lowerCaseName = dbName.toLowerCase();
if (lowerCaseName.contains(SupportedDatabase.derby.toString())) {
@@ -39,28 +41,28 @@ public enum SupportedDatabase {
} else {
throw new OseeDataStoreException("Unsupported database type: " + dbName);
}
- return toReturn;
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
+ return toReturn;
}
- public static boolean isDatabaseType(DatabaseMetaData metaData, SupportedDatabase dbType) throws OseeDataStoreException {
+ public static boolean isDatabaseType(DatabaseMetaData metaData, SupportedDatabase dbType) throws OseeCoreException {
return getDatabaseType(metaData) == dbType;
}
- public static boolean areHintsSupported(DatabaseMetaData metaData) throws OseeDataStoreException {
+ public static boolean areHintsSupported(DatabaseMetaData metaData) throws OseeCoreException {
try {
if (SupportedDatabase.isDatabaseType(metaData, oracle)) {
return metaData.getDatabaseMajorVersion() > 10;
}
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
return false;
}
- public static String getComplementSql(DatabaseMetaData metaData) throws OseeDataStoreException {
+ public static String getComplementSql(DatabaseMetaData metaData) throws OseeCoreException {
return isDatabaseType(metaData, oracle) ? "MINUS" : "EXCEPT";
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionImpl.java
index ba11b6820e..e0a7521cea 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionImpl.java
@@ -16,7 +16,8 @@ import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.core.OseeConnection;
public class OseeConnectionImpl extends OseeConnection {
@@ -40,11 +41,12 @@ public class OseeConnectionImpl extends OseeConnection {
}
@Override
- public boolean isClosed() throws OseeDataStoreException {
+ public boolean isClosed() throws OseeCoreException {
try {
return conn.isClosed();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return false; // unreachable since wrapAndThrow() always throws an exception
}
}
@@ -54,11 +56,12 @@ public class OseeConnectionImpl extends OseeConnection {
}
@Override
- public DatabaseMetaData getMetaData() throws OseeDataStoreException {
+ public DatabaseMetaData getMetaData() throws OseeCoreException {
try {
return conn.getMetaData();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@@ -84,11 +87,11 @@ public class OseeConnectionImpl extends OseeConnection {
}
@Override
- protected void destroy() throws OseeDataStoreException {
+ protected void destroy() throws OseeCoreException {
try {
conn.close();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
pool.removeConnection(this);
}
@@ -107,17 +110,22 @@ public class OseeConnectionImpl extends OseeConnection {
}
@Override
- protected void setAutoCommit(boolean autoCommit) throws OseeDataStoreException {
+ protected void setAutoCommit(boolean autoCommit) throws OseeCoreException {
try {
conn.setAutoCommit(autoCommit);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
@Override
- protected boolean getAutoCommit() throws SQLException {
- return conn.getAutoCommit();
+ protected boolean getAutoCommit() throws OseeCoreException {
+ try {
+ return conn.getAutoCommit();
+ } catch (SQLException ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ return false; // unreachable since wrapAndThrow() always throws an exception
+ }
}
@Override
@@ -126,11 +134,11 @@ public class OseeConnectionImpl extends OseeConnection {
}
@Override
- protected void rollback() throws OseeDataStoreException {
+ protected void rollback() throws OseeCoreException {
try {
conn.rollback();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
index ee4b2a53e8..84a16a28cc 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeConnectionPoolImpl.java
@@ -17,6 +17,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.core.IConnectionFactory;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.database.internal.Activator;
@@ -59,7 +60,7 @@ public class OseeConnectionPoolImpl {
connections.remove(conn);
}
- public synchronized OseeConnectionImpl getConnection() throws OseeDataStoreException {
+ public synchronized OseeConnectionImpl getConnection() throws OseeCoreException {
for (OseeConnectionImpl connection : connections) {
if (connection.lease()) {
return connection;
@@ -70,21 +71,22 @@ public class OseeConnectionPoolImpl {
throw new OseeDataStoreException(
"This client has reached the maximum number of allowed simultaneous database connections of : " + MAX_CONNECTIONS_PER_CLIENT);
}
- try {
- OseeConnectionImpl connection = getOseeConnection();
- connections.add(connection);
- OseeLog.log(Activator.class, Level.INFO, String.format("DbConnection: [%s] - [%d]", dbUrl, connections.size()));
- return connection;
- } catch (Throwable th) {
- throw new OseeDataStoreException("Unable to get a database connection: ", th);
- }
+ OseeConnectionImpl connection = getOseeConnection();
+ connections.add(connection);
+ OseeLog.log(Activator.class, Level.INFO, String.format("DbConnection: [%s] - [%d]", dbUrl, connections.size()));
+ return connection;
}
- private OseeConnectionImpl getOseeConnection() throws Exception {
- IConnectionFactory connectionDriver = createConnection(driver);
- Connection connection = connectionDriver.getConnection(properties, dbUrl);
- connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
- return new OseeConnectionImpl(connection, this);
+ private OseeConnectionImpl getOseeConnection() throws OseeCoreException {
+ try {
+ IConnectionFactory connectionDriver = createConnection(driver);
+ Connection connection = connectionDriver.getConnection(properties, dbUrl);
+ connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+ return new OseeConnectionImpl(connection, this);
+ } catch (Exception ex) {
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
+ }
}
synchronized void returnConnection(OseeConnectionImpl connection) {
@@ -94,13 +96,13 @@ public class OseeConnectionPoolImpl {
} else {
connection.expireLease();
}
- } catch (OseeDataStoreException ex) {
+ } catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
removeConnection(connection);
}
}
- synchronized void releaseUneededConnections() throws OseeDataStoreException {
+ synchronized void releaseUneededConnections() throws OseeCoreException {
for (OseeConnectionImpl connection : connections) {
if (connection.isStale()) {
connection.destroy();
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
index b753c90824..e41f76905a 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeDatabaseServiceImpl.java
@@ -20,6 +20,7 @@ import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IDatabaseInfo;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
@@ -61,7 +62,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public OseeConnection getConnection() throws OseeDataStoreException {
+ public OseeConnection getConnection() throws OseeCoreException {
return getConnection(getDatabaseInfoProvider());
}
@@ -81,7 +82,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public OseeConnection getConnection(IDatabaseInfo databaseInfo) throws OseeDataStoreException {
+ public OseeConnection getConnection(IDatabaseInfo databaseInfo) throws OseeCoreException {
return getConnectionPool(databaseInfo).getConnection();
}
@@ -106,7 +107,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeDataStoreException {
+ public <O extends Object> int runPreparedUpdate(OseeConnection connection, String query, O... data) throws OseeCoreException {
if (connection == null) {
return runPreparedUpdate(query, data);
}
@@ -117,7 +118,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
StatementUtil.populateValuesForPreparedStatement(preparedStatement, data);
updateCount = preparedStatement.executeUpdate();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
} finally {
StatementUtil.close(preparedStatement);
}
@@ -125,7 +126,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeDataStoreException {
+ public <O extends Object> int runBatchUpdate(OseeConnection connection, String query, List<O[]> dataList) throws OseeCoreException {
if (connection == null) {
return runBatchUpdate(query, dataList);
}
@@ -158,7 +159,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
if ((exlist = ex.getNextException()) != null) {
OseeLog.log(Activator.class, Level.SEVERE, "This is the nested exception", exlist);
}
- throw new OseeDataStoreException(
+ throw new OseeCoreException(
"sql update failed: \n" + query + "\n" + StatementUtil.getBatchErrorMessage(dataList), ex);
} finally {
StatementUtil.close(preparedStatement);
@@ -167,7 +168,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public <O> int runBatchUpdate(String query, List<O[]> dataList) throws OseeDataStoreException {
+ public <O> int runBatchUpdate(String query, List<O[]> dataList) throws OseeCoreException {
OseeConnection connection = getConnection();
try {
return runBatchUpdate(connection, query, dataList);
@@ -177,7 +178,7 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public <O> int runPreparedUpdate(String query, O... data) throws OseeDataStoreException {
+ public <O> int runPreparedUpdate(String query, O... data) throws OseeCoreException {
OseeConnection connection = getConnection();
try {
return runPreparedUpdate(connection, query, data);
@@ -187,22 +188,18 @@ public class OseeDatabaseServiceImpl implements IOseeDatabaseService {
}
@Override
- public <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeDataStoreException {
+ public <T, O extends Object> T runPreparedQueryFetchObject(T defaultValue, String query, O... data) throws OseeCoreException {
return runPreparedQueryFetchObject(getStatement(), defaultValue, query, data);
}
@Override
- public <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeDataStoreException {
+ public <T, O extends Object> T runPreparedQueryFetchObject(OseeConnection connection, T defaultValue, String query, O... data) throws OseeCoreException {
return runPreparedQueryFetchObject(getStatement(connection), defaultValue, query, data);
}
@SuppressWarnings("unchecked")
- private <T, O extends Object> T runPreparedQueryFetchObject(IOseeStatement chStmt, T defaultValue, String query, O... data) throws OseeDataStoreException {
- try {
- Conditions.checkNotNull(defaultValue, "default value");
- } catch (OseeCoreException ex) {
- throw new OseeDataStoreException(ex);
- }
+ private <T, O extends Object> T runPreparedQueryFetchObject(IOseeStatement chStmt, T defaultValue, String query, O... data) throws OseeCoreException {
+ Conditions.checkNotNull(defaultValue, "default value");
try {
chStmt.runPreparedQuery(1, query, data);
if (chStmt.next()) {
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java
index 3cc7d8b54a..7709bee7d9 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeSequenceImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.database.internal.core;
import java.util.HashMap;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeSequence;
@@ -55,7 +56,7 @@ public class OseeSequenceImpl implements IOseeSequence {
@Override
@SuppressWarnings("unchecked")
- public synchronized long getNextSequence(String sequenceName) throws OseeDataStoreException {
+ public synchronized long getNextSequence(String sequenceName) throws OseeCoreException {
SequenceRange range = getRange(sequenceName);
if (range.lastAvailable == 0) {
long lastValue = -1L;
@@ -88,89 +89,89 @@ public class OseeSequenceImpl implements IOseeSequence {
}
@SuppressWarnings("unchecked")
- private void internalInitializeSequence(String sequenceName) throws OseeDataStoreException {
+ private void internalInitializeSequence(String sequenceName) throws OseeCoreException {
SequenceRange range = getRange(sequenceName);
range.lastAvailable = 0;
getDatabase().runPreparedUpdate(INSERT_SEQUENCE, 0, sequenceName);
}
@Override
- public int getNextSessionId() throws OseeDataStoreException {
+ public int getNextSessionId() throws OseeCoreException {
return (int) getNextSequence(TTE_SESSION_SEQ);
}
@Override
- public int getNextTransactionId() throws OseeDataStoreException {
+ public int getNextTransactionId() throws OseeCoreException {
return (int) getNextSequence(TRANSACTION_ID_SEQ);
}
@Override
- public int getNextArtifactId() throws OseeDataStoreException {
+ public int getNextArtifactId() throws OseeCoreException {
return (int) getNextSequence(ART_ID_SEQ);
}
@Override
- public int getNextOseeEnumTypeId() throws OseeDataStoreException {
+ public int getNextOseeEnumTypeId() throws OseeCoreException {
return (int) getNextSequence(ENUM_TYPE_ID_SEQ);
}
@Override
- public int getNextGammaId() throws OseeDataStoreException {
+ public int getNextGammaId() throws OseeCoreException {
return (int) getNextSequence(GAMMA_ID_SEQ);
}
@Override
- public int getNextArtifactTypeId() throws OseeDataStoreException {
+ public int getNextArtifactTypeId() throws OseeCoreException {
return (int) getNextSequence(ART_TYPE_ID_SEQ);
}
@Override
- public int getNextAttributeBaseTypeId() throws OseeDataStoreException {
+ public int getNextAttributeBaseTypeId() throws OseeCoreException {
return (int) getNextSequence(ATTR_BASE_TYPE_ID_SEQ);
}
@Override
- public int getNextAttributeProviderTypeId() throws OseeDataStoreException {
+ public int getNextAttributeProviderTypeId() throws OseeCoreException {
return (int) getNextSequence(ATTR_PROVIDER_TYPE_ID_SEQ);
}
@Override
- public int getNextAttributeId() throws OseeDataStoreException {
+ public int getNextAttributeId() throws OseeCoreException {
return (int) getNextSequence(ATTR_ID_SEQ);
}
@Override
- public int getNextAttributeTypeId() throws OseeDataStoreException {
+ public int getNextAttributeTypeId() throws OseeCoreException {
return (int) getNextSequence(ATTR_TYPE_ID_SEQ);
}
@Override
- public int getNextFactoryId() throws OseeDataStoreException {
+ public int getNextFactoryId() throws OseeCoreException {
return (int) getNextSequence(FACTORY_ID_SEQ);
}
@Override
- public int getNextBranchId() throws OseeDataStoreException {
+ public int getNextBranchId() throws OseeCoreException {
return (int) getNextSequence(BRANCH_ID_SEQ);
}
@Override
- public int getNextRelationTypeId() throws OseeDataStoreException {
+ public int getNextRelationTypeId() throws OseeCoreException {
return (int) getNextSequence(REL_LINK_TYPE_ID_SEQ);
}
@Override
- public int getNextRelationId() throws OseeDataStoreException {
+ public int getNextRelationId() throws OseeCoreException {
return (int) getNextSequence(REL_LINK_ID_SEQ);
}
@Override
- public int getNextImportId() throws OseeDataStoreException {
+ public int getNextImportId() throws OseeCoreException {
return (int) getNextSequence(IMPORT_ID_SEQ);
}
@Override
- public int getNextImportMappedIndexId() throws OseeDataStoreException {
+ public int getNextImportMappedIndexId() throws OseeCoreException {
return (int) getNextSequence(IMPORT_MAPPED_INDEX_SEQ);
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java
index 926f756d14..25b2bce1e7 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/OseeStatementImpl.java
@@ -21,7 +21,8 @@ import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.database.core.SupportedDatabase;
@@ -63,7 +64,7 @@ public final class OseeStatementImpl implements IOseeStatement {
}
@Override
- public void runPreparedQuery(String query, Object... data) throws OseeDataStoreException {
+ public void runPreparedQuery(String query, Object... data) throws OseeCoreException {
runPreparedQuery(0, query, data);
}
@@ -72,7 +73,7 @@ public final class OseeStatementImpl implements IOseeStatement {
* to 10,000
*/
@Override
- public void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeDataStoreException {
+ public void runPreparedQuery(int fetchSize, String query, Object... data) throws OseeCoreException {
try {
allowReuse();
@@ -82,7 +83,7 @@ public final class OseeStatementImpl implements IOseeStatement {
rSet = preparedStatement.executeQuery();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
@@ -91,7 +92,7 @@ public final class OseeStatementImpl implements IOseeStatement {
* as in parameters
*/
@Override
- public void runCallableStatement(String query, Object... data) throws OseeDataStoreException {
+ public void runCallableStatement(String query, Object... data) throws OseeCoreException {
try {
allowReuse();
@@ -107,17 +108,17 @@ public final class OseeStatementImpl implements IOseeStatement {
rSet = callableStatement.getResultSet();
}
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
@Override
- public boolean next() throws OseeDataStoreException {
+ public boolean next() throws OseeCoreException {
if (rSet != null) {
try {
return rSet.next();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
return false;
@@ -135,7 +136,7 @@ public final class OseeStatementImpl implements IOseeStatement {
connection.close();
connection = null;// this allows for multiple calls to runPreparedQuery to have an open connection
}
- } catch (OseeDataStoreException ex) {
+ } catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
@@ -143,14 +144,14 @@ public final class OseeStatementImpl implements IOseeStatement {
/**
* allows for multiple uses of this object to have an open connection
*/
- private void allowReuse() throws OseeDataStoreException {
+ private void allowReuse() throws OseeCoreException {
if (connection == null) {
connection = connectionPool.getConnection();
}
closePreviousResources();
}
- private void closePreviousResources() throws OseeDataStoreException {
+ private void closePreviousResources() throws OseeCoreException {
try {
if (rSet != null) {
rSet.close();
@@ -162,88 +163,97 @@ public final class OseeStatementImpl implements IOseeStatement {
callableStatement.close();
}
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
@Override
- public InputStream getBinaryStream(String columnName) throws OseeDataStoreException {
+ public InputStream getBinaryStream(String columnName) throws OseeCoreException {
try {
return rSet.getBinaryStream(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public InputStream getAsciiStream(String columnName) throws OseeDataStoreException {
+ public InputStream getAsciiStream(String columnName) throws OseeCoreException {
try {
return rSet.getAsciiStream(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public String getString(String columnName) throws OseeDataStoreException {
+ public String getString(String columnName) throws OseeCoreException {
try {
return rSet.getString(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public float getFloat(String columnName) throws OseeDataStoreException {
+ public float getFloat(String columnName) throws OseeCoreException {
try {
return rSet.getFloat(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0.0f; // unreachable since wrapAndThrow() always throws an exceptions
}
}
@Override
- public long getLong(String columnName) throws OseeDataStoreException {
+ public long getLong(String columnName) throws OseeCoreException {
try {
return rSet.getLong(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public int getInt(String columnName) throws OseeDataStoreException {
+ public int getInt(String columnName) throws OseeCoreException {
try {
return rSet.getInt(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public int getInt(int columnIndex) throws OseeDataStoreException {
+ public int getInt(int columnIndex) throws OseeCoreException {
try {
return rSet.getInt(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public int getCallableInt(int columnIndex) throws OseeDataStoreException {
+ public int getCallableInt(int columnIndex) throws OseeCoreException {
try {
return callableStatement.getInt(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public double getCallableDouble(int columnIndex) throws OseeDataStoreException {
+ public double getCallableDouble(int columnIndex) throws OseeCoreException {
try {
return callableStatement.getDouble(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@@ -251,11 +261,12 @@ public final class OseeStatementImpl implements IOseeStatement {
* should not be used by application code because it is less readable than using the column name
*/
@Override
- public long getLong(int columnIndex) throws OseeDataStoreException {
+ public long getLong(int columnIndex) throws OseeCoreException {
try {
return rSet.getLong(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@@ -263,110 +274,122 @@ public final class OseeStatementImpl implements IOseeStatement {
* should not be used by application code because it is less readable than using the column name
*/
@Override
- public String getString(int columnIndex) throws OseeDataStoreException {
+ public String getString(int columnIndex) throws OseeCoreException {
try {
return rSet.getString(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public Timestamp getTimestamp(String columnName) throws OseeDataStoreException {
+ public Timestamp getTimestamp(String columnName) throws OseeCoreException {
try {
return rSet.getTimestamp(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public BigDecimal getBigDecimal(String name) throws OseeDataStoreException {
+ public BigDecimal getBigDecimal(String name) throws OseeCoreException {
try {
return rSet.getBigDecimal(name);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public Time getTime(String name) throws OseeDataStoreException {
+ public Time getTime(String name) throws OseeCoreException {
try {
return rSet.getTime(name);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public double getDouble(String columnName) throws OseeDataStoreException {
+ public double getDouble(String columnName) throws OseeCoreException {
try {
return rSet.getDouble(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public Date getDate(String columnName) throws OseeDataStoreException {
+ public Date getDate(String columnName) throws OseeCoreException {
try {
return rSet.getDate(columnName);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public boolean wasNull() throws OseeDataStoreException {
+ public boolean wasNull() throws OseeCoreException {
try {
return rSet.wasNull();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return false; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public int getColumnCount() throws OseeDataStoreException {
+ public int getColumnCount() throws OseeCoreException {
try {
return rSet.getMetaData().getColumnCount();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public String getColumnName(int columnIndex) throws OseeDataStoreException {
+ public String getColumnName(int columnIndex) throws OseeCoreException {
try {
return rSet.getMetaData().getColumnName(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public int getColumnType(int columnIndex) throws OseeDataStoreException {
+ public int getColumnType(int columnIndex) throws OseeCoreException {
try {
return rSet.getMetaData().getColumnType(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public String getColumnTypeName(int columnIndex) throws OseeDataStoreException {
+ public String getColumnTypeName(int columnIndex) throws OseeCoreException {
try {
return rSet.getMetaData().getColumnTypeName(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public Object getObject(int columnIndex) throws OseeDataStoreException {
+ public Object getObject(int columnIndex) throws OseeCoreException {
try {
return rSet.getObject(columnIndex);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return null; // unreachable since wrapAndThrow() always throws an exception
}
}
@@ -377,50 +400,52 @@ public final class OseeStatementImpl implements IOseeStatement {
* @return the number of rows in the result set
*/
@Override
- public int getRowCount() throws OseeDataStoreException {
+ public int getRowCount() throws OseeCoreException {
try {
rSet.last();
return rSet.getRow();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return 0; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public boolean isNullable(int columnIndex) throws OseeDataStoreException {
+ public boolean isNullable(int columnIndex) throws OseeCoreException {
try {
return rSet.getMetaData().isNullable(columnIndex) == ResultSetMetaData.columnNullable;
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
+ return false; // unreachable since wrapAndThrow() always throws an exception
}
}
@Override
- public String getComplementSql() throws OseeDataStoreException {
+ public String getComplementSql() throws OseeCoreException {
allowReuse();
return SupportedDatabase.getComplementSql(connection.getMetaData());
}
@Override
- public boolean isDatabaseType(SupportedDatabase type) throws OseeDataStoreException {
+ public boolean isDatabaseType(SupportedDatabase type) throws OseeCoreException {
return SupportedDatabase.isDatabaseType(connection.getMetaData(), type);
}
@Override
- public void updateObject(String columnName, Object value) throws OseeDataStoreException {
+ public void updateObject(String columnName, Object value) throws OseeCoreException {
try {
rSet.updateObject(columnName, value);
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
@Override
- public void updateRow() throws OseeDataStoreException {
+ public void updateRow() throws OseeCoreException {
try {
rSet.updateRow();
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StaleConnectionCloser.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StaleConnectionCloser.java
index 4915411cec..c8c3cd9bf8 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StaleConnectionCloser.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StaleConnectionCloser.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.database.internal.core;
import java.util.TimerTask;
import java.util.logging.Level;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.internal.Activator;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -31,7 +31,7 @@ public class StaleConnectionCloser extends TimerTask {
public void run() {
try {
connectionPool.releaseUneededConnections();
- } catch (OseeDataStoreException ex) {
+ } catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
index ae34da7ffb..16edb6c9d5 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/internal/core/StatementUtil.java
@@ -16,7 +16,9 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.database.internal.Activator;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -82,7 +84,7 @@ public class StatementUtil {
}
}
- public static <O extends Object> void populateValuesForPreparedStatement(PreparedStatement preparedStatement, O... data) throws OseeDataStoreException {
+ public static <O extends Object> void populateValuesForPreparedStatement(PreparedStatement preparedStatement, O... data) throws OseeCoreException {
try {
int preparedIndex = 0;
for (Object dataValue : data) {
@@ -115,7 +117,7 @@ public class StatementUtil {
}
}
} catch (SQLException ex) {
- throw new OseeDataStoreException(ex);
+ OseeExceptions.wrapAndThrow(ex);
}
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
index 1d67ac3da1..18e548ed81 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
@@ -16,7 +16,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.operation.OperationReporter;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
@@ -312,7 +311,7 @@ public class ConsolidateArtifactVersionTxOperation extends AbstractDbTxOperation
return String.format(sql, archived ? "_archived" : "");
}
- private void writeAddressingChanges(boolean archived, boolean force) throws OseeDataStoreException {
+ private void writeAddressingChanges(boolean archived, boolean force) throws OseeCoreException {
String archivedStr = archived ? "_archived" : "";
if (addressingToDelete.size() > 99960 || force) {
deleteTxsCounter +=
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
index 88afb20a85..70e4903bef 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/InvalidTxCurrentsAndModTypes.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.OperationReporter;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
@@ -53,7 +53,7 @@ public class InvalidTxCurrentsAndModTypes extends AbstractOperation {
txsTableName = archived ? "_archived" : "";
}
- private void fixIssues(IProgressMonitor monitor) throws OseeDataStoreException {
+ private void fixIssues(IProgressMonitor monitor) throws OseeCoreException {
if (isFixOperationEnabled) {
checkForCancelledStatus(monitor);
ConnectionHandler.runBatchUpdate(String.format(DELETE_ADDRESS, txsTableName), purgeData);

Back to the top