Index: runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	(revision 4410)
+++ runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	(working copy)
@@ -81,6 +81,7 @@
 		
 		workContext.setSecurityHelper(csr.getSecurityHelper());
 		workContext.setUseCallingThread(useCallingThread);
+		workContext.setSecurityContext(csr.getSecurityHelper().getSecurityContext());
 		authenticate();
 		passthrough = Boolean.valueOf(connectionProperties.getProperty(TeiidURL.CONNECTION.PASSTHROUGH_AUTHENTICATION, "false")); //$NON-NLS-1$
 	}
Index: runtime/src/main/java/org/teiid/services/TeiidLoginContext.java
===================================================================
--- runtime/src/main/java/org/teiid/services/TeiidLoginContext.java	(revision 4410)
+++ runtime/src/main/java/org/teiid/services/TeiidLoginContext.java	(working copy)
@@ -80,7 +80,10 @@
 					this.userName = getUserName(existing)+AT+domain;
 					this.securitydomain = domain;     
 					this.loginContext = createLoginContext(domain, existing);
-			        this.securityContext = this.securityHelper.getSecurityContext(this.securitydomain);
+					Object sc = this.securityHelper.getSecurityContext();
+					if (sc != null && this.securityHelper.getSecurityDomain(sc).equals(this.securitydomain)) {
+						this.securityContext = this.securityHelper.getSecurityContext();
+					}
 					return;
 	        	}
             }
Index: engine/src/test/java/org/teiid/dqp/internal/process/TestDQPWorkContext.java
===================================================================
--- engine/src/test/java/org/teiid/dqp/internal/process/TestDQPWorkContext.java	(revision 4410)
+++ engine/src/test/java/org/teiid/dqp/internal/process/TestDQPWorkContext.java	(working copy)
@@ -110,7 +110,7 @@
 				return null;
 			}
 			@Override
-			public Object getSecurityContext(String securityDomain) {
+			public Object getSecurityContext() {
 				return this.mycontext;
 			}
 			@Override
@@ -127,6 +127,10 @@
 				this.mycontext = context;
 				return old;
 			}
+			@Override
+			public String getSecurityDomain(Object context) {
+				return null;
+			}
 		};	
 		Object previousSC = sc.createSecurityContext("test", null, null, null); //$NON-NLS-1$
 		sc.associateSecurityContext(previousSC);
@@ -144,13 +148,13 @@
 		Runnable r = new Runnable() {
 			@Override
 			public void run() {
-				assertEquals(currentSC, sc.getSecurityContext(null));
+				assertEquals(currentSC, sc.getSecurityContext());
 			}
 		};
 		
 		message.runInContext(r);
 		
-		assertEquals(previousSC, sc.getSecurityContext(null));
+		assertEquals(previousSC, sc.getSecurityContext());
 	}	
 	
 	
Index: engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java
===================================================================
--- engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java	(revision 4410)
+++ engine/src/main/java/org/teiid/dqp/internal/process/DQPWorkContext.java	(working copy)
@@ -215,6 +215,10 @@
 		return session.getSecurityContext();
 	}
 	
+	public void setSecurityContext(Object securityContext) {
+		session.setSecurityContext(securityContext);
+	}	
+	
 	public VDBMetaData getVDB() {
 		return session.getVdb();
 	}
Index: engine/src/main/java/org/teiid/security/SecurityHelper.java
===================================================================
--- engine/src/main/java/org/teiid/security/SecurityHelper.java	(revision 4410)
+++ engine/src/main/java/org/teiid/security/SecurityHelper.java	(working copy)
@@ -32,11 +32,13 @@
 	
 	void clearSecurityContext();
 	
-	Object getSecurityContext(String securityDomain);
+	Object getSecurityContext();
 	
 	Object createSecurityContext(String securityDomain, Principal p, Object credentials, Subject subject);
 
 	Subject getSubjectInContext(String securityDomain);
 	
 	boolean sameSubject(String securityDomain, Object context, Subject subject);
+	
+	String getSecurityDomain(Object context);
 }
Index: jboss-integration/src/main/java/org/teiid/jboss/JBossSecurityHelper.java
===================================================================
--- jboss-integration/src/main/java/org/teiid/jboss/JBossSecurityHelper.java	(revision 4410)
+++ jboss-integration/src/main/java/org/teiid/jboss/JBossSecurityHelper.java	(working copy)
@@ -50,12 +50,8 @@
 	}
 	
 	@Override
-	public Object getSecurityContext(String securityDomain) {
-		SecurityContext sc = SecurityActions.getSecurityContext();
-		if (sc != null && sc.getSecurityDomain().equals(securityDomain)) {
-			return sc;
-		}
-		return null;
+	public Object getSecurityContext() {
+		return SecurityActions.getSecurityContext();
 	}	
 	
 	@Override
@@ -89,5 +85,10 @@
 		}
 		return false;
 	}
+
+	@Override
+	public String getSecurityDomain(Object context) {
+		return ((SecurityContext)context).getSecurityDomain();
+	}
 	
 }
