From e7235ace0f68aabbf9ae87376c6fa23116830deb Mon Sep 17 00:00:00 2001 From: jmisinco Date: Mon, 18 Jul 2011 16:06:14 -0700 Subject: bug: SessionUtil throwing NullPointerException --- .../core/server/internal/task/CleanJoinTablesServerTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/task/CleanJoinTablesServerTask.java b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/task/CleanJoinTablesServerTask.java index a7c21389a0e..21f287cd291 100644 --- a/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/task/CleanJoinTablesServerTask.java +++ b/plugins/org.eclipse.osee.framework.core.server/src/org/eclipse/osee/framework/core/server/internal/task/CleanJoinTablesServerTask.java @@ -17,6 +17,7 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.server.IServerTask; +import org.eclipse.osee.framework.core.server.ISession; import org.eclipse.osee.framework.core.server.ISessionManager; import org.eclipse.osee.framework.core.server.SchedulingScheme; import org.eclipse.osee.framework.core.server.SessionUtil; @@ -73,13 +74,15 @@ public class CleanJoinTablesServerTask implements IServerTask { try { chStmt = ConnectionHandler.getStatement(); chStmt.runPreparedQuery(SELECT_SESSION_FROM_JOIN); + String prevSessionId = ""; while (chStmt.next()) { String sessionId = chStmt.getString("session_id"); String tableName = chStmt.getString("table_name"); Integer queryId = chStmt.getInt("query_id"); if (!sessionId.equals(prevSessionId)) { - isAlive = SessionUtil.isAlive(manager.getSessionById(sessionId)); + ISession sessionById = manager.getSessionById(sessionId); + isAlive = sessionById != null && SessionUtil.isAlive(sessionById); } if (!isAlive) { queryIds.add(new Integer[] {queryId}); -- cgit v1.2.3