[teiid-commits] teiid SVN: r1179 - trunk/runtime/src/main/java/org/teiid/transport.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Thu Jul 23 16:52:40 EDT 2009


Author: rareddy
Date: 2009-07-23 16:52:39 -0400 (Thu, 23 Jul 2009)
New Revision: 1179

Modified:
   trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
   trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
Log:
TEIID-734: This exception was happening for two reasons. One Channel handler was throwing a exception when the channel is closed, even when the client requested it. And ping call was being used with invalid session, instead just pinging the server instance. Both were corrected.

Modified: trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java	2009-07-23 20:48:25 UTC (rev 1178)
+++ trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java	2009-07-23 20:52:39 UTC (rev 1179)
@@ -144,9 +144,19 @@
 		return sessionID;
 	}
 	
+	private void resetDQPContext() {
+		DQPWorkContext workContext = DQPWorkContext.getWorkContext();
+		workContext.setSessionToken(null);
+		workContext.setAppName(null);
+		workContext.setTrustedPayload(null);
+		workContext.setVdbName(null);
+		workContext.setVdbVersion(null);
+	}	
+	
 	public ResultsFuture<?> logoff() throws InvalidSessionException, MetaMatrixComponentException {
 		try {
 			this.service.closeSession(DQPWorkContext.getWorkContext().getSessionId());
+			resetDQPContext();
 		} catch (SessionServiceException e) {
 			throw new MetaMatrixComponentException(e);
 		} 
@@ -154,7 +164,12 @@
 	}
 
 	public ResultsFuture<?> ping() throws InvalidSessionException,MetaMatrixComponentException {
-		this.service.pingServer(DQPWorkContext.getWorkContext().getSessionId());
+		// ping is double used to alert the aliveness of the client, as well as check the server instance is 
+		// alive by socket server instance, so that they can be cached.
+		MetaMatrixSessionID id = DQPWorkContext.getWorkContext().getSessionId();
+		if (id != null) {
+			this.service.pingServer(id);
+		}
 		return null;
 	}
 

Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java	2009-07-23 20:48:25 UTC (rev 1178)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java	2009-07-23 20:52:39 UTC (rev 1179)
@@ -54,9 +54,10 @@
 import org.jboss.netty.handler.codec.serialization.ObjectEncoder;
 import org.jboss.netty.handler.ssl.SslHandler;
 
-import com.metamatrix.common.comm.exception.SingleInstanceCommunicationException;
 import com.metamatrix.common.comm.platform.CommPlatformPlugin;
 import com.metamatrix.common.comm.platform.socket.ObjectChannel;
+import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.util.LogConstants;
 
 /**
  * Main class for creating Netty Nio Channels 
@@ -216,7 +217,7 @@
 			ChannelStateEvent e) throws Exception {
 		ChannelListener listener = this.listeners.remove(e.getChannel());
 		if (listener != null) {
-			listener.exceptionOccurred(new SingleInstanceCommunicationException(CommPlatformPlugin.Util.getString("SSLAwareChannelHandler.channel_closed"))); //$NON-NLS-1$
+			LogManager.logDetail(LogConstants.CTX_SERVER, CommPlatformPlugin.Util.getString("SSLAwareChannelHandler.channel_closed")); //$NON-NLS-1$
 		}
 	}
 



More information about the teiid-commits mailing list