[teiid-commits] teiid SVN: r2774 - in trunk: build/kits/jboss-container and 41 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Dec 13 17:02:32 EST 2010


Author: shawkins
Date: 2010-12-13 17:02:28 -0500 (Mon, 13 Dec 2010)
New Revision: 2774

Added:
   trunk/common-core/src/test/java/org/teiid/core/util/TestInputStreamReader.java
Removed:
   trunk/common-core/src/test/java/org/teiid/core/util/FakeInputStream.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/impl/PropertyListToArrayValueAdapter.java
Modified:
   trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
   trunk/build/kits/jboss-container/teiid-releasenotes.html
   trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
   trunk/client/src/main/java/org/teiid/adminapi/Admin.java
   trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
   trunk/client/src/main/java/org/teiid/net/HostInfo.java
   trunk/common-core/src/main/java/org/teiid/core/util/InputStreamReader.java
   trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java
   trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
   trunk/connectors/connector-salesforce/src/main/rar/META-INF/ra.xml
   trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/IdentifierFunctionModifier.java
   trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java
   trunk/console/pom.xml
   trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/api/PropertyAdapterFactory.java
   trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
   trunk/console/src/main/resources/META-INF/rhq-plugin.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
   trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
   trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
   trunk/engine/src/main/java/org/teiid/query/sql/visitor/CriteriaTranslatorVisitor.java
   trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
   trunk/engine/src/main/resources/org/teiid/query/i18n.properties
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
   trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
   trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
   trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
   trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
   trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
   trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
   trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java
   trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
   trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
   trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
   trunk/test-integration/db/src/assembly/binaries.xml
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ExpectedResults.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClientTransaction.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/TagNames.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLGenerateResults.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryVisitationStrategy.java
   trunk/test-integration/db/src/main/java/org/teiid/test/client/impl/ExpectedResultsImpl.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java
   trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
   trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
   trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh
   trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
   trunk/test-integration/db/src/test/resources/TransactionsRevisited.vdb
Log:
forward merge from 7.1.1

Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -141,6 +141,14 @@
 			@Doc(text = "cache type") String cacheType) throws AdminException {
 		getAdmin().clearCache(cacheType);
 	}
+	
+	@Doc(text = "Clear the given cache for a VDB")
+	public static void clearCache(
+			@Doc(text = "cache type") String cacheType, @Doc(text = "vdb name") String vdbName, 
+			@Doc(text = "vdb version") int vdbVersion			
+			) throws AdminException {
+		getAdmin().clearCache(cacheType, vdbName, vdbVersion);
+	}	
 
 	@Doc(text = "Delete a VDB")
 	public static void deleteVDB(

Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html	2010-12-13 22:02:28 UTC (rev 2774)
@@ -38,7 +38,7 @@
 
 <h2><a name="Compatibility">Compatibility Issues</a></h2>
 <ul>
-  <li>TRANSLATE CRITERIA has been deprecated.  An alternative approach to update procedures will be introduced in a subsequent version.
+  <li>TRANSLATE/HAS CRITERIA has been deprecated.  An alternative approach to update procedures will be introduced in a subsequent version.
   <li>Support for named parameter syntax using param=value has been deprecated, since it is ambiguous with a comparison predicate boolean value expression.  param<b>=></b>value should be used instead.  
 </ul>
 <h4>from 7.1</h4>

Modified: trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -64,7 +64,6 @@
 			
 			Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
 			Node node = cacheRoot.addChild(Fqn.fromString(type.location()));
-			node.put(ExpirationAlgorithmConfig.EXPIRATION_KEY, Long.MAX_VALUE);
 			node.setResident(true);
 			
 			Region cacheRegion = this.cacheStore.getRegion(node.getFqn(), true);

Modified: trunk/client/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/Admin.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/client/src/main/java/org/teiid/adminapi/Admin.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -168,6 +168,16 @@
      * @throws AdminException  
      */
     void clearCache(String cacheType) throws AdminException;
+    
+    /**
+     * Clear the cache of the given VDB for provided cache type
+     * @param cacheType Cache Type
+     * No wild cards currently supported, must be explicit
+     * @param vdbName - Name of the VDB
+     * @param vdbVersion - VDB version
+     * @throws AdminException  
+     */
+    void clearCache(String cacheType, String vdbName, int vdbVersion) throws AdminException;    
 
     
     /**

Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/DQPManagement.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -35,6 +35,7 @@
     boolean cancelRequest(String sessionId, long requestId) throws AdminException;
     Collection<String> getCacheTypes();
     void clearCache(String cacheType);
+    void clearCache(String cacheType, String vdbName, int version);
     Collection<SessionMetadata> getActiveSessions() throws AdminException;
     int getActiveSessionsCount() throws AdminException;
     Collection<org.teiid.adminapi.Transaction> getTransactions();

Modified: trunk/client/src/main/java/org/teiid/net/HostInfo.java
===================================================================
--- trunk/client/src/main/java/org/teiid/net/HostInfo.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/client/src/main/java/org/teiid/net/HostInfo.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -113,12 +113,12 @@
         if (portNumber != hostInfo.getPortNumber()) {
         	return false;
         }
+        if (ssl != hostInfo.ssl) {
+        	return false;
+        }
         if (inetAddress != null && hostInfo.inetAddress != null) {
         	return inetAddress.equals(hostInfo.inetAddress);
         }
-        if (ssl != hostInfo.ssl) {
-        	return false;
-        }
         return hostName.equals(hostInfo.getHostName());
     }
 

Modified: trunk/common-core/src/main/java/org/teiid/core/util/InputStreamReader.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/InputStreamReader.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/common-core/src/main/java/org/teiid/core/util/InputStreamReader.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -89,8 +89,12 @@
 	    			cr.throwException();
 	    		}
 	    		done = true;
-	    	} 
-			bb.clear();
+	    	}
+	    	if (bb.position() != read) {
+	    		bb.compact();
+	    	} else {
+	    		bb.clear();
+	    	}
     		cb.flip();
 		}
 		len = Math.min(len, cb.remaining());

Deleted: trunk/common-core/src/test/java/org/teiid/core/util/FakeInputStream.java
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/FakeInputStream.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/common-core/src/test/java/org/teiid/core/util/FakeInputStream.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.core.util;
-
-import java.io.ByteArrayInputStream;
-
-/**
- * This test input stream overrides the <code>available</code>
- * to return "1" until <i>after</i> the {@link #read} method returns
- * "-1" to indicate EOF, which is how java.util.zip.ZipInputStream
- * works, which is what is used by ExtensionSourceManager to retrieve
- * Class files from JAR files.  The <code>available</code> method
- * therefore can't be relied on by ByteArrayHelper to either
- * indicate how many bytes can be read, or if more are
- * available or not.  In the latter case, ByteArrayHelper
- * relies on the <code>read</code> method returning "-1".
- */
-public class FakeInputStream extends ByteArrayInputStream {
-
-    private int available = 1;
-
-    public FakeInputStream(byte[] buf) {
-        super(buf);
-    }
-
-    /**
-     * Overriden to return "1" <i>until</i> the <code>read</code> method
-     * has returned "-1" to indicate EOF.
-     */
-    public int available(){
-        super.available();
-        return available;
-    }
-
-    /**
-     * Overriden - basically calls to super method, but checks returned
-     * number of bytes read; if "-1", then the next call to
-     * {@link #available} will return "0".
-     */
-    public int read(byte b[], int off, int len) {
-        int result = super.read(b, off, len);
-        if (result<0){
-            available = 0;
-        }
-        return result;
-    }
-
-}

Copied: trunk/common-core/src/test/java/org/teiid/core/util/TestInputStreamReader.java (from rev 2773, branches/7.1.x/common-core/src/test/java/org/teiid/core/util/TestInputStreamReader.java)
===================================================================
--- trunk/common-core/src/test/java/org/teiid/core/util/TestInputStreamReader.java	                        (rev 0)
+++ trunk/common-core/src/test/java/org/teiid/core/util/TestInputStreamReader.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -0,0 +1,18 @@
+package org.teiid.core.util;
+
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.nio.charset.Charset;
+
+import org.junit.Test;
+
+ at SuppressWarnings("nls")
+public class TestInputStreamReader {
+
+	@Test public void testMultiByte() throws Exception {
+		InputStreamReader isr = new InputStreamReader(new ByteArrayInputStream(new byte[] {(byte)80, (byte)-61, (byte)-70}), Charset.forName("UTF-8").newDecoder(), 2);
+		assertEquals(80, isr.read());
+		assertEquals(250, isr.read());
+	}
+}

Modified: trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesForceManagedConnectionFactory.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -35,28 +35,19 @@
 	private static final long serialVersionUID = 5298591275313314698L;
 	
 	private String username;
-	private String connectorStateClass;
 	private String password;
 	private URL URL;
-	private long sourceConnectionTestInterval = -1;
-	private int sourceConnectionTimeout = -1;
-	private boolean auditModelFields = false;
 	
 	public String getUsername() {
 		return username;
 	}
 	public void setUsername(String username) {
 		if (username.trim().length() == 0) {
-			throw new TeiidRuntimeException("Name can not be null");
+			throw new TeiidRuntimeException("Name can not be null"); //$NON-NLS-1$
 		}
 		this.username = username;
 	}
-	public String getConnectorStateClass() {
-		return this.connectorStateClass;
-	}
-	public void setConnectorStateClass(String connectorStateClass) {
-		this.connectorStateClass = connectorStateClass;
-	}
+
 	public String getPassword() {
 		return this.password;
 	}
@@ -71,35 +62,18 @@
 		try {
 			this.URL = new URL(uRL);
 		} catch (MalformedURLException e) {
-			throw new TeiidRuntimeException("URL Supplied is not valid URL"+ e.getMessage());
+			throw new TeiidRuntimeException("URL Supplied is not valid URL"+ e.getMessage());//$NON-NLS-1$
 		}
 	}
 	
-	public long getSourceConnectionTestInterval() {
-		return sourceConnectionTestInterval;
-	}
-	public void setSourceConnectionTestInterval(Long sourceConnectionTestInterval) {
-		this.sourceConnectionTestInterval = sourceConnectionTestInterval.longValue();
-	}
-	public int getSourceConnectionTimeout() {
-		return sourceConnectionTimeout;
-	}
-	public void setSourceConnectionTimeout(Integer sourceConnectionTimeout) {
-		this.sourceConnectionTimeout = sourceConnectionTimeout.intValue();
-	}
-	public void setModelAuditFields(Boolean modelAuditFields) {
-		this.auditModelFields = modelAuditFields.booleanValue();
-	}
-	public boolean isModelAuditFields() {
-		return this.auditModelFields;
-	}	
-	
 	@Override
 	public BasicConnectionFactory createConnectionFactory() throws ResourceException {
 		return new BasicConnectionFactory() {
+			private static final long serialVersionUID = 5028356110047329135L;
+
 			@Override
 			public SalesforceConnectionImpl getConnection() throws ResourceException {
-				return new SalesforceConnectionImpl(getUsername(), getPassword(), getURL(), getSourceConnectionTestInterval(), getSourceConnectionTimeout());
+				return new SalesforceConnectionImpl(getUsername(), getPassword(), getURL());
 			}
 		};
 	}

Modified: trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
--- trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -72,8 +72,8 @@
 	
 	PackageVersionHeader pvHeader = partnerFactory.createPackageVersionHeader();
 	
-	public SalesforceConnectionImpl(String username, String password, URL url, long pingInterval, int timeout) throws ResourceException {
-		login(username, password, url, timeout);
+	public SalesforceConnectionImpl(String username, String password, URL url) throws ResourceException {
+		login(username, password, url);
 	}
 	
 	String getUserName() throws ResourceException {
@@ -88,24 +88,24 @@
 		return sfSoap;
 	}
 	
-	private void login(String username, String password, URL url, int timeout) throws ResourceException {
+	private void login(String username, String password, URL url) throws ResourceException {
 		if (!isValid()) {
 			LoginResult loginResult = null;
 			sfSoap = null;
 			sfService = null;
 			co = new CallOptions();
+			// This value identifies Teiid as a SF certified solution.
+			// It was provided by SF and should not be changed.
 			co.setClient("RedHat/MetaMatrix/"); //$NON-NLS-1$
+			
+			if(url == null) {
+				throw new ResourceException("SalesForce URL is not specified, please provide a valid URL"); //$NON-NLS-1$
+			}
 
 			try {
-				/*
-				if(null != url) {
-					sfService = new SforceService(url);
-					sfSoap = sfService.getSoap();
-				} else {
-					*/
-					sfService = new SforceService();
-					sfSoap = sfService.getSoap();
-				//}
+				sfService = new SforceService();
+				sfSoap = sfService.getSoap();
+				((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
 				loginResult = sfSoap.login(username, password);
 			} catch (LoginFault e) {
 				throw new ResourceException(e.getCause().getMessage());
@@ -377,4 +377,9 @@
 	public void close() throws ResourceException {
 		
 	}
+	
+	@Override
+	public boolean isAlive() {
+		return isValid();
+	}	
 }

Modified: trunk/connectors/connector-salesforce/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-salesforce/src/main/rar/META-INF/ra.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/connectors/connector-salesforce/src/main/rar/META-INF/ra.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -56,22 +56,9 @@
                <description>{$display:"Salesforce URL",$description:"URL for connecting to Salesforce",$advanced:"true"}</description>
                <config-property-name>URL</config-property-name>
                <config-property-type>java.lang.String</config-property-type>
+               <config-property-value>https://www.salesforce.com/services/Soap/u/17.0</config-property-value>
             </config-property>     
             
-            <config-property>
-               <description>{$display:"Source Connection Test Interval",$advanced:"true"}</description>
-               <config-property-name>SourceConnectionTestInterval</config-property-name>
-               <config-property-type>java.lang.Long</config-property-type>
-               <config-property-value>5000</config-property-value>
-            </config-property>   
-            
-            <config-property>
-               <description>{$display:"Source Connection Timeout",$advanced:"true"}</description>
-               <config-property-name>SourceConnectionTimeout</config-property-name>
-               <config-property-type>java.lang.Integer</config-property-type>
-               <config-property-value>120000</config-property-value>
-            </config-property>           
-            
             <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
             <connectionfactory-impl-class>org.teiid.resource.spi.WrappedConnectionFactory</connectionfactory-impl-class>
             <connection-interface>javax.resource.cci.Connection</connection-interface>

Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/IdentifierFunctionModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/IdentifierFunctionModifier.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/modeshape/IdentifierFunctionModifier.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -62,7 +62,7 @@
     				if ("\"mode:properties\"".equalsIgnoreCase(c.getNameInSource())) { //$NON-NLS-1$
     					dotAll = true;
     					useSelector = true;
-    				} else if ("\"mode:path\"".equalsIgnoreCase(c.getNameInSource())) { //$NON-NLS-1$
+    				} else if ("\"jcr:path\"".equalsIgnoreCase(c.getNameInSource())) { //$NON-NLS-1$
     					useSelector = true;
     				}
     			}

Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/modeshape/TestModeShapeSqlTranslator.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -61,13 +61,13 @@
     	Schema modeshape = RealMetadataFactory.createPhysicalModel("modeshape", store);
     	Table nt_base = RealMetadataFactory.createPhysicalGroup("nt_base", modeshape);
     	nt_base.setNameInSource("\"nt:base\"");
-		List<Column> cols = RealMetadataFactory.createElements(nt_base, new String[] { "mode_path",
+		List<Column> cols = RealMetadataFactory.createElements(nt_base, new String[] { "jcr_path",
 				"mode_properties", "jcr_primaryType", "prop" }, new String[] {
 				TypeFacility.RUNTIME_NAMES.STRING,
 				TypeFacility.RUNTIME_NAMES.STRING,
 				TypeFacility.RUNTIME_NAMES.STRING,
 				TypeFacility.RUNTIME_NAMES.STRING });
-		cols.get(0).setNameInSource("\"mode:path\"");
+		cols.get(0).setNameInSource("\"jcr:path\"");
 		cols.get(1).setNameInSource("\"mode:properties\"");
 		cols.get(2).setNameInSource("\"jcr:primaryType\"");
     	return RealMetadataFactory.createTransformationMetadata(store, "modeshape");
@@ -81,7 +81,7 @@
 	@Test
 	public void testSelectAllFromBase() throws Exception {
 		String input = "select * from nt_base"; //$NON-NLS-1$
-		String output = "SELECT g_0.\"mode:path\", g_0.\"mode:properties\", g_0.\"jcr:primaryType\", g_0.prop FROM \"nt:base\" AS g_0"; //$NON-NLS-1$
+		String output = "SELECT g_0.\"jcr:path\", g_0.\"mode:properties\", g_0.\"jcr:primaryType\", g_0.prop FROM \"nt:base\" AS g_0"; //$NON-NLS-1$
 
 		helpTestVisitor(input, output);
 
@@ -90,7 +90,7 @@
 	@Test
 	public void testPredicate() throws Exception {
 
-		String input = "SELECT x.jcr_primaryType from nt_base inner join nt_base as x on jcr_issamenode(nt_base.mode_path, x.mode_path) = true where jcr_isdescendantnode(nt_base.mode_path, 'x/y/z') = true and jcr_reference(nt_base.mode_properties) = 'x'"; //$NON-NLS-1$
+		String input = "SELECT x.jcr_primaryType from nt_base inner join nt_base as x on jcr_issamenode(nt_base.jcr_path, x.jcr_path) = true where jcr_isdescendantnode(nt_base.jcr_path, 'x/y/z') = true and jcr_reference(nt_base.mode_properties) = 'x'"; //$NON-NLS-1$
 		String output = "SELECT g_1.\"jcr:primaryType\" FROM \"nt:base\" AS g_0 INNER JOIN \"nt:base\" AS g_1 ON issamenode(g_0, g_1) WHERE isdescendantnode(g_0, 'x/y/z') AND reference(g_0.*) = 'x'"; //$NON-NLS-1$
 
 		helpTestVisitor(input, output);

Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/pom.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<parent>
 		<artifactId>teiid-parent</artifactId>
 		<groupId>org.jboss.teiid</groupId>
@@ -19,6 +20,7 @@
 		<jopr.jboss.as5.plugin.version>1.4.0.B01</jopr.jboss.as5.plugin.version>
 		<org.rhq.version>1.3.0.GA</org.rhq.version>
 		<apache.ant.version>1.7.0</apache.ant.version>
+		<teiid.version>${project.version}</teiid.version>
 
 
 	</properties>
@@ -152,9 +154,10 @@
 		</dependency>
 
 
-
 	</dependencies>
 
+
+
 	<build>
 		<outputDirectory>target/classes</outputDirectory>
 		<resources>
@@ -166,14 +169,6 @@
 					<include>**/*.properties</include>
 				</includes>
 			</resource>
-			<resource>
-				<directory>src/main/resources</directory>
-				<filtering>false</filtering>
-				<excludes>
-					<exclude>**/*.xml</exclude>
-					<exclude>**/*.properties</exclude>
-				</excludes>
-			</resource>
 		</resources>
 	</build>
 

Modified: trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/admin/DQPManagementView.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -43,7 +43,6 @@
 import org.jboss.metatype.api.values.CompositeValueSupport;
 import org.jboss.metatype.api.values.GenericValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
 import org.jboss.metatype.api.values.SimpleValue;
 import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
@@ -54,6 +53,8 @@
 import org.teiid.adminapi.VDB.Status;
 import org.teiid.adminapi.impl.RequestMetadata;
 import org.teiid.adminapi.impl.RequestMetadataMapper;
+import org.teiid.adminapi.impl.SessionMetadataMapper;
+import org.teiid.adminapi.impl.TransactionMetadataMapper;
 import org.teiid.rhq.plugin.objects.ExecutedResult;
 import org.teiid.rhq.plugin.util.DeploymentUtils;
 import org.teiid.rhq.plugin.util.PluginConstants;
@@ -65,7 +66,6 @@
 
 	private static ManagedComponent mc = null;
 	private static final Log LOG = LogFactory.getLog(PluginConstants.DEFAULT_LOGGER_CATEGORY);
-	private static final MetaValueFactory metaValueFactory = MetaValueFactory.getInstance();
 
 	private static final String VDB_EXT = ".vdb"; //$NON-NLS-1$
 
@@ -153,7 +153,7 @@
 	 */
 
 	public void executeOperation(ProfileServiceConnection connection,
-			ExecutedResult operationResult, final Map<String, Object> valueMap) {
+			ExecutedResult operationResult, final Map<String, Object> valueMap) throws Exception {
 
 		if (operationResult.getComponentType().equals(PluginConstants.ComponentType.Platform.NAME)) {
 			executePlatformOperation(connection, operationResult,	operationResult.getOperationName(), valueMap);
@@ -190,7 +190,7 @@
 			operationResult.setContent(createReportResultList(fieldNameList,	resultObject.iterator()));
 		} else if (operationName.equals(Platform.Operations.KILL_TRANSACTION)) {
 			Long sessionID = (Long) valueMap.get(Operation.Value.TRANSACTION_ID);
-			MetaValue[] args = new MetaValue[] { metaValueFactory	.create(sessionID) };
+			MetaValue[] args = new MetaValue[] { SimpleValueSupport.wrap(sessionID) };
 			try {
 				executeManagedOperation(connection, getRuntimeEngineDeployer(connection, mc), Platform.Operations.KILL_TRANSACTION, args);
 			} catch (Exception e) {
@@ -199,7 +199,7 @@
 			}
 		} else if (operationName.equals(Platform.Operations.KILL_SESSION)) {
 			Long sessionID = (Long) valueMap.get(Operation.Value.SESSION_ID);
-			MetaValue[] args = new MetaValue[] { metaValueFactory	.create(sessionID) };
+			MetaValue[] args = new MetaValue[] { SimpleValueSupport.wrap(sessionID) };
 			try {
 				executeManagedOperation(connection, getRuntimeEngineDeployer(connection, mc), Platform.Operations.KILL_SESSION, args);
 			} catch (Exception e) {
@@ -210,8 +210,8 @@
 			Long requestID = (Long) valueMap.get(Operation.Value.REQUEST_ID);
 			Long sessionID = (Long) valueMap.get(Operation.Value.SESSION_ID);
 			MetaValue[] args = new MetaValue[] {
-					metaValueFactory.create(requestID),
-					metaValueFactory.create(sessionID) };
+					SimpleValueSupport.wrap(requestID),
+					SimpleValueSupport.wrap(sessionID) };
 			try {
 				executeManagedOperation(connection, getRuntimeEngineDeployer(connection, mc), Platform.Operations.KILL_REQUEST, args);
 			} catch (Exception e) {
@@ -247,11 +247,12 @@
 
 	private void executeVdbOperation(ProfileServiceConnection connection,
 			ExecutedResult operationResult, final String operationName,
-			final Map<String, Object> valueMap) {
+			final Map<String, Object> valueMap) throws Exception {
 		Collection<ArrayList<String>> sqlResultsObject = new ArrayList<ArrayList<String>>();
 		Collection<Request> resultObject = new ArrayList<Request>();
-		Collection<Session> activeSessionsCollection = new ArrayList<Session>();
+		Collection<MetaValue> activeSessionsCollection = new ArrayList<MetaValue>();
 		String vdbName = (String) valueMap.get(PluginConstants.ComponentType.VDB.NAME);
+		vdbName = formatVdbName(vdbName);
 		String vdbVersion = (String) valueMap.get(PluginConstants.ComponentType.VDB.VERSION);
 
 		if (operationName.equals(VDB.Operations.GET_PROPERTIES)) {
@@ -270,11 +271,25 @@
 			operationResult.setContent(createReportResultList(fieldNameList,	resultObject.iterator()));
 		} else if (operationName.equals(VDB.Operations.GET_MATVIEWS)) {
 			List<String> fieldNameList = operationResult.getFieldNameList();
-			MetaValue resultsMetaValue = executeMaterializedViewQuery(	connection, formatVdbName(vdbName), Integer.parseInt(vdbVersion));
+			MetaValue resultsMetaValue = executeMaterializedViewQuery(	connection, vdbName, Integer.parseInt(vdbVersion));
 			getResultsCollectionValue(resultsMetaValue, sqlResultsObject);
 			operationResult.setContent(createReportResultListForMatViewQuery(fieldNameList, sqlResultsObject.iterator()));
+		} else if (operationName.equals(VDB.Operations.CLEAR_CACHE)) {
+			
+			try {
+			executeClearCache(	connection, vdbName, Integer.parseInt(vdbVersion), 
+					(String) valueMap.get(Operation.Value.CACHE_TYPE));
+				
+			}catch(Exception e){
+				//Some failure during Clear Cache. Set message here since it has already been logged.
+				operationResult.setContent("failure - see log for details"); //$NON-NLS-1$
+			}
+
+			//If no exceptions, we assume the clear cache worked
+			operationResult.setContent("cache successfully cleared!"); //$NON-NLS-1$
+		
 		} else if (operationName.equals(VDB.Operations.RELOAD_MATVIEW)) {
-			MetaValue resultsMetaValue = reloadMaterializedView(connection,	formatVdbName(vdbName), Integer.parseInt(vdbVersion),
+			MetaValue resultsMetaValue = reloadMaterializedView(connection,	vdbName, Integer.parseInt(vdbVersion),
 					(String) valueMap.get(Operation.Value.MATVIEW_SCHEMA),
 					(String) valueMap.get(Operation.Value.MATVIEW_TABLE),
 					(Boolean) valueMap.get(Operation.Value.INVALIDATE_MATVIEW));
@@ -329,15 +344,31 @@
 
 	}
 
+	protected void executeClearCache(
+			ProfileServiceConnection connection, String vdbName, int vdbVersion, String cacheType) throws Exception {
+
+		MetaValue[] args = new MetaValue[] {SimpleValueSupport.wrap(cacheType),
+				SimpleValueSupport.wrap(vdbName),
+				SimpleValueSupport.wrap(vdbVersion) }; 
+
+		try {
+			executeManagedOperation(connection,	getRuntimeEngineDeployer(connection, mc),	VDB.Operations.CLEAR_CACHE, args);
+		} catch (Exception e) {
+			final String msg = "Exception executing operation: " + VDB.Operations.EXECUTE_QUERIES; //$NON-NLS-1$
+			LOG.error(msg, e);
+			throw e;
+		}
+	}
+	
 	protected MetaValue executeMaterializedViewQuery(
 			ProfileServiceConnection connection, String vdbName, int vdbVersion) {
 
 		MetaValue resultsCollection = null;
 		MetaValue[] args = new MetaValue[] {
-				MetaValueFactory.getInstance().create(vdbName),
-				MetaValueFactory.getInstance().create(vdbVersion),
-				MetaValueFactory.getInstance().create(Operation.Value.MAT_VIEW_QUERY),	
-				MetaValueFactory.getInstance().create(Long.parseLong("9999999")) }; //$NON-NLS-1$
+				SimpleValueSupport.wrap(vdbName),
+				SimpleValueSupport.wrap(vdbVersion),
+				SimpleValueSupport.wrap(Operation.Value.MAT_VIEW_QUERY),	
+				SimpleValueSupport.wrap(Long.parseLong("9999999")) }; //$NON-NLS-1$
 
 		try {
 			resultsCollection = executeManagedOperation(connection,	getRuntimeEngineDeployer(connection, mc),	VDB.Operations.EXECUTE_QUERIES, args);
@@ -360,10 +391,10 @@
 		query = query.replace("param1", matView); //$NON-NLS-1$
 		query = query.replace("param2", invalidate.toString()); //$NON-NLS-1$
 		MetaValue[] args = new MetaValue[] {
-				MetaValueFactory.getInstance().create(vdbName),
-				MetaValueFactory.getInstance().create(vdbVersion),
-				MetaValueFactory.getInstance().create(query),
-				MetaValueFactory.getInstance().create(Long.parseLong("9999999")) }; //$NON-NLS-1$
+				SimpleValueSupport.wrap(vdbName),
+				SimpleValueSupport.wrap(vdbVersion),
+				SimpleValueSupport.wrap(query),
+				SimpleValueSupport.wrap(Long.parseLong("9999999")) }; //$NON-NLS-1$
 
 		try {
 			result = executeManagedOperation(connection,	getRuntimeEngineDeployer(connection, mc),
@@ -383,8 +414,8 @@
 
 		MetaValue requestsCollection = null;
 		MetaValue[] args = new MetaValue[] {
-				MetaValueFactory.getInstance().create(vdbName),
-				MetaValueFactory.getInstance().create(vdbVersion) };
+				SimpleValueSupport.wrap(vdbName),
+				SimpleValueSupport.wrap(vdbVersion) };
 
 		try {
 			requestsCollection = executeManagedOperation(connection,
@@ -651,7 +682,7 @@
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 				if (value.getMetaType().isComposite()) {
-					RequestMetadataMapper rmm = new RequestMetadataMapper();
+					RequestMetadataMapper rmm = new RequestMetadataMapper(); 
 					RequestMetadata request = rmm.unwrapMetaValue(value);
 					list.add(request);
 				} else {
@@ -661,23 +692,31 @@
 		}
 	}
 
-	private void getResultsCollectionValue(MetaValue pValue, Collection<ArrayList<String>> list) {
+	private void getResultsCollectionValue(MetaValue pValue, Collection<ArrayList<String>> list) throws Exception {
 		MetaType metaType = pValue.getMetaType();
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 				if (value.getMetaType().isCollection()) {
-					ArrayList<String> row = (ArrayList<String>) MetaValueFactory.getInstance().unwrap(value);
+					ArrayList<String> row = new ArrayList<String>();
+					MetaValue[] metaValueArray = ((CollectionValueSupport)value).getElements();
+					for (MetaValue cell : metaValueArray){
+						row.add(ProfileServiceUtil.stringValue(cell));
+					}
 					list.add(row);
 				}
 			}
 		}
 	}
 
-	private void getResultsCollectionValueForMatViewRefresh(MetaValue pValue, Collection<ArrayList<String>> list) {
+	private void getResultsCollectionValueForMatViewRefresh(MetaValue pValue, Collection<ArrayList<String>> list) throws Exception {
 		MetaType metaType = pValue.getMetaType();
 		for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 			if (value.getMetaType().isCollection()) {
-				ArrayList<String> row = (ArrayList<String>) MetaValueFactory.getInstance().unwrap(value);
+				ArrayList<String> row = new ArrayList<String>();
+				MetaValue[] metaValueArray = ((CollectionValueSupport)value).getElements();
+				for (MetaValue cell : metaValueArray){
+					row.add(ProfileServiceUtil.stringValue(cell));
+				}
 				list.add(row);
 			}
 		}
@@ -688,7 +727,8 @@
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 				if (value.getMetaType().isComposite()) {
-					Transaction transaction = (Transaction) MetaValueFactory.getInstance().unwrap(value);
+					TransactionMetadataMapper tmm = new TransactionMetadataMapper(); 
+					Transaction transaction = tmm.unwrapMetaValue(value);
 					list.add(transaction);
 				} else {
 					throw new IllegalStateException(pValue
@@ -703,8 +743,9 @@
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 				if (value.getMetaType().isComposite()) {
-					Session Session = (Session) MetaValueFactory.getInstance().unwrap(value);
-					list.add(Session);
+					SessionMetadataMapper rmm = new SessionMetadataMapper(); 
+					Session session = rmm.unwrapMetaValue(value);
+					list.add(session);
 				} else {
 					throw new IllegalStateException(pValue
 							+ " is not a Composite type"); //$NON-NLS-1$
@@ -713,14 +754,13 @@
 		}
 	}
 
-	public static <T> void getSessionCollectionValueForVDB(MetaValue pValue,Collection<Session> list, String vdbName) {
+	public static <T> void getSessionCollectionValueForVDB(MetaValue pValue,Collection<MetaValue> list, String vdbName) throws Exception {
 		MetaType metaType = pValue.getMetaType();
 		if (metaType.isCollection()) {
 			for (MetaValue value : ((CollectionValueSupport) pValue).getElements()) {
 				if (value.getMetaType().isComposite()) {
-					Session session = (Session) MetaValueFactory.getInstance().unwrap(value);
-					if (session.getVDBName().equals(vdbName)) {
-						list.add(session);
+					if (ProfileServiceUtil.stringValue(((CompositeValueSupport)value).get("VDBName")).equals(vdbName)) { //$NON-NLS-1$
+						list.add(value);
 					}
 				} else {
 					throw new IllegalStateException(pValue+ " is not a Composite type"); //$NON-NLS-1$

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -22,11 +22,7 @@
 package org.teiid.rhq.plugin;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.NamingException;
@@ -36,19 +32,15 @@
 import org.jboss.deployers.spi.management.ManagementView;
 import org.jboss.managed.api.ComponentType;
 import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.types.CollectionMetaType;
 import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.MetaTypeFactory;
 import org.jboss.metatype.api.types.SimpleMetaType;
 import org.jboss.metatype.api.values.CollectionValueSupport;
-import org.jboss.metatype.api.values.CompositeValueSupport;
-import org.jboss.metatype.api.values.EnumValueSupport;
-import org.jboss.metatype.api.values.GenericValue;
 import org.jboss.metatype.api.values.GenericValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-import org.jboss.metatype.api.values.SimpleValue;
 import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.mc4j.ems.connection.EmsConnection;
 import org.rhq.core.domain.configuration.Configuration;
@@ -57,30 +49,25 @@
 import org.rhq.core.domain.configuration.PropertyList;
 import org.rhq.core.domain.configuration.PropertyMap;
 import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.configuration.definition.ConfigurationDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinition;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
+import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap;
 import org.rhq.core.domain.measurement.AvailabilityType;
-import org.rhq.core.domain.measurement.MeasurementDataNumeric;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
 import org.rhq.core.domain.measurement.MeasurementReport;
 import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
 import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
 import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
 import org.rhq.core.pluginapi.inventory.CreateResourceReport;
-import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
 import org.rhq.core.pluginapi.inventory.ResourceContext;
 import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
-import org.rhq.plugins.jbossas5.util.ConversionUtils;
-import org.teiid.adminapi.impl.PropertyMetadata;
-import org.teiid.rhq.admin.DQPManagementView;
+import org.teiid.rhq.plugin.adapter.api.PropertyAdapter;
+import org.teiid.rhq.plugin.adapter.api.PropertyAdapterFactory;
 import org.teiid.rhq.plugin.util.PluginConstants;
 import org.teiid.rhq.plugin.util.ProfileServiceUtil;
-import org.teiid.rhq.plugin.util.PluginConstants.Operation;
-import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.Platform;
-import org.teiid.rhq.plugin.util.PluginConstants.ComponentType.VDB;
 
 /**
- * Component class for a Teiid VDB
+ * Component class for a Teiid VDB Data Role
  * 
  */
 public class DataRoleComponent extends Facet {
@@ -99,6 +86,7 @@
 		this.componentType = PluginConstants.ComponentType.DATA_ROLE.NAME;
 		super.start(context);
 	}
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -106,7 +94,8 @@
 	 */
 	@Override
 	public AvailabilityType getAvailability() {
-		return ((VDBComponent)this.resourceContext.getParentResourceComponent()).getAvailability();
+		return ((VDBComponent) this.resourceContext
+				.getParentResourceComponent()).getAvailability();
 	}
 
 	@Override
@@ -118,9 +107,9 @@
 	public void getValues(MeasurementReport arg0,
 			Set<MeasurementScheduleRequest> arg1) throws Exception {
 		// TODO Auto-generated method stub
-		
+
 	}
-	
+
 	/**
 	 * The plugin container will call this method when it has a new
 	 * configuration for your managed resource. Your plugin will re-configure
@@ -150,44 +139,53 @@
 					((VDBComponent) this.resourceContext
 							.getParentResourceComponent()).name, componentType);
 			ManagedProperty mp = managedComponent.getProperty("dataPolicies");//$NON-NLS-1$
-			List<ManagedObject> dataRolesListMp = (List<ManagedObject>) MetaValueFactory
-					.getInstance().unwrap(mp.getValue());
+			CollectionValueSupport dataRolesListMp = (CollectionValueSupport) mp
+					.getValue();
 			String name = resourceConfiguration.getSimpleValue("name", null); //$NON-NLS-1$
 			String anyAuthenticated = resourceConfiguration.getSimpleValue(
 					"anyAuthenticated", null); //$NON-NLS-1$
 
-			for (ManagedObject mo : dataRolesListMp) {
+			for (MetaValue val : dataRolesListMp.getElements()) {
+				GenericValueSupport genValueSupport = (GenericValueSupport) val;
+				ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+						.getValue();
 
-				String pname = ProfileServiceUtil.stringValue(mo.getProperty(
-						"name").getValue()); //$NON-NLS-1$
-				if (!pname.equals(name)) {
-					continue;
+				for (String dataRolesProp : managedObject.getPropertyNames()) {
+					ManagedProperty property = managedObject
+							.getProperty(dataRolesProp);
+
+					String pname = ProfileServiceUtil.stringValue(managedObject
+							.getProperty("name").getValue()); //$NON-NLS-1$
+					if (!pname.equals(name)) {
+						continue;
+					}
+
+					anyAuthenticatedMp = managedObject
+							.getProperty("anyAuthenticated"); //$NON-NLS-1$
+					anyAuthenticatedMp.setValue(ProfileServiceUtil.wrap(
+							SimpleMetaType.BOOLEAN, anyAuthenticated));
+					List<Property> mappedRoleNamePropertyList = resourceConfiguration.getList("mappedRoleNameList").getList(); //$NON-NLS-1$
+					List<String> mappedRoleNameList = new ArrayList<String>();
+					
+					for (Property mappedRoleNameProperty : mappedRoleNamePropertyList){
+						String mappedRoleNameString = ((PropertyMap)mappedRoleNameProperty).getSimpleValue("name", null); //$NON-NLS-1$
+						mappedRoleNameList.add(mappedRoleNameString);
+					}
+					ManagedProperty mappedRoleNameMp = managedObject.getProperty("mappedRoleNames"); //$NON-NLS-1$
+					mappedRoleNameMp.setValue(convertListOfStringsToMetaValue(mappedRoleNameList));
 				}
-				anyAuthenticatedMp = mo.getProperty("anyAuthenticated"); //$NON-NLS-1$
-				anyAuthenticatedMp.setValue(ProfileServiceUtil.wrap(
-						SimpleMetaType.BOOLEAN, anyAuthenticated));
-				List<Property> mappedRoleNamePropertyList = resourceConfiguration
-				.getList("mappedRoleNameList").getList(); //$NON-NLS-1$
 
-				List<String> mappedRoleNameList = new ArrayList<String>();
-				
-				for (Property mappedRoleNameProperty : mappedRoleNamePropertyList){
-					String mappedRoleNameString = ((PropertyMap)mappedRoleNameProperty).getSimpleValue("name", null); //$NON-NLS-1$
-					mappedRoleNameList.add(mappedRoleNameString);
+				try {
+					managementView.updateComponent(managedComponent);
+					managementView.load();
+				} catch (Exception e) {
+					LOG.error("Unable to update component [" //$NON-NLS-1$
+							+ managedComponent.getName() + "] of type " //$NON-NLS-1$
+							+ componentType + ".", e); //$NON-NLS-1$
+					report.setStatus(ConfigurationUpdateStatus.FAILURE);
+					report.setErrorMessageFromThrowable(e);
 				}
-				ManagedProperty mappedRoleNameMp = mo.getProperty("mappedRoleNames"); //$NON-NLS-1$
-				mappedRoleNameMp.setValue(MetaValueFactory.getInstance().create(mappedRoleNameList));
 			}
-
-			try {
-				managementView.updateComponent(managedComponent);
-			} catch (Exception e) {
-				LOG.error("Unable to update component [" //$NON-NLS-1$
-						+ managedComponent.getName() + "] of type " //$NON-NLS-1$
-						+ componentType + ".", e); //$NON-NLS-1$
-				report.setStatus(ConfigurationUpdateStatus.FAILURE);
-				report.setErrorMessageFromThrowable(e);
-			}
 		} catch (Exception e) {
 			LOG.error("Unable to process update request", e); //$NON-NLS-1$
 			report.setStatus(ConfigurationUpdateStatus.FAILURE);
@@ -196,6 +194,24 @@
 
 	}
 
+	/**
+	 * @param mappedRoleNameList
+	 */
+	private MetaValue convertListOfStringsToMetaValue(List<String> mappedRoleNameList) {
+		 
+		 MetaValue[] listMemberValues = new MetaValue[mappedRoleNameList.size()];
+		 int memberIndex = 0;
+		 
+		 for (String mappedRoleName : mappedRoleNameList)
+	     {
+	      MetaValue mappedRoleNameValue = SimpleValueSupport.wrap(mappedRoleName);
+	      listMemberValues[memberIndex++] = mappedRoleNameValue;
+	     }
+	     return new CollectionValueSupport( new CollectionMetaType("java.util.List", SimpleMetaType.STRING), //$NON-NLS-1$
+	    		                            listMemberValues);
+	     
+	}
+
 	@Override
 	public Configuration loadResourceConfiguration() {
 
@@ -246,14 +262,21 @@
 				configuration.put(mappedRoleNameList);
 				ManagedProperty mappedRoleNames = managedObject
 						.getProperty("mappedRoleNames"); //$NON-NLS-1$
-				if (mappedRoleNames != null) { 
-					List<String> props = (List<String>) MetaValueFactory
-							.getInstance().unwrap(mappedRoleNames.getValue());
-					for (String mappedRoleName : props) {
+				if (mappedRoleNames != null) {
+					CollectionValueSupport props = (CollectionValueSupport) mappedRoleNames
+							.getValue();
+					for (MetaValue mappedRoleName : props.getElements()) {
 						PropertyMap mappedRoleNameMap = null;
 
-						mappedRoleNameMap = new PropertyMap("map", //$NON-NLS-1$
-								new PropertySimple("name", mappedRoleName)); //$NON-NLS-1$
+						try {
+							mappedRoleNameMap = new PropertyMap(
+									"map", //$NON-NLS-1$
+									new PropertySimple(
+											"name", (ProfileServiceUtil.stringValue(mappedRoleName)))); //$NON-NLS-1$
+						} catch (Exception e) {
+							final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+							LOG.error(msg, e);
+						}
 						mappedRoleNameList.add(mappedRoleNameMap);
 					}
 				}

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/DataRoleDiscoveryComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -22,23 +22,19 @@
 package org.teiid.rhq.plugin;
 
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.managed.api.ComponentType;
 import org.jboss.managed.api.ManagedComponent;
-import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.managed.plugins.ManagedObjectImpl;
 import org.jboss.metatype.api.values.CollectionValueSupport;
 import org.jboss.metatype.api.values.GenericValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.configuration.PropertyMap;
 import org.rhq.core.domain.configuration.PropertySimple;
 import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
 import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
@@ -120,10 +116,9 @@
 				ManagedProperty mappedRoleNames = managedObject
 						.getProperty("mappedRoleNames");
 				if (mappedRoleNames != null) {
-					List<String> props = (List<String>) MetaValueFactory
-							.getInstance().unwrap(mappedRoleNames.getValue());
-					for (String mappedRoleName : props) {
-						mappedRoleNameList.add(new PropertySimple("name", mappedRoleName));
+					CollectionValueSupport props = (CollectionValueSupport)mappedRoleNames.getValue();
+					for (MetaValue mappedRoleName : props.getElements()) {
+						mappedRoleNameList.add(new PropertySimple("name", ProfileServiceUtil.stringValue(mappedRoleName)));
 					}
 
 				}

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/Facet.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -224,7 +224,11 @@
 			final ExecutedResult result, final Map<String, Object> valueMap) {
 		DQPManagementView dqp = new DQPManagementView();
 
-		dqp.executeOperation(connection, result, valueMap);
+		try {
+			dqp.executeOperation(connection, result, valueMap);
+		} catch (Exception e) {
+			new RuntimeException(e);
+		}
 
 	}
 

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -192,6 +192,8 @@
 			report.setStatus(ConfigurationUpdateStatus.FAILURE);
 			report.setErrorMessageFromThrowable(e);
 		}
+		
+		managementView.load();
 
 	}
 
@@ -204,8 +206,8 @@
 	public Configuration loadResourceConfiguration() {
 
 		// Get plugin config
-		Configuration c = resourceContext.getPluginConfiguration();
-
+		Configuration c = resourceConfiguration;
+		
 		getProperties(c);
 
 		return c;

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/PlatformDiscoveryComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -90,8 +90,7 @@
 		);
 
 		Configuration configuration = detail.getPluginConfiguration();
-		configuration.put(new PropertySimple(
-				PluginConstants.Operation.Value.LONG_RUNNING_QUERY_LIMIT, 600));
+		configuration.put(new PropertySimple("displayPreviewVDBS", Boolean.FALSE));
 		detail.setPluginConfiguration(configuration);
 
 		// Add to return values

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -32,8 +32,8 @@
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
 import org.mc4j.ems.connection.EmsConnection;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertyList;
@@ -140,7 +140,11 @@
 
 		// First get translator specific properties
 		ManagedProperty translatorProps = translator.getProperty("property");
-		getTranslatorValues(translatorProps.getValue(), propMap, list);
+		try {
+			getTranslatorValues(translatorProps.getValue(), propMap, list);
+		} catch (Exception e) {
+			throw new RuntimeException(e.getMessage());
+		}
 
 		// Now get common properties
 		c.put(new PropertySimple("name", translatorName));
@@ -151,16 +155,16 @@
 	}
 	
 	public static <T> void getTranslatorValues(MetaValue pValue,
-			PropertyMap map, PropertyList list) {
+			PropertyMap map, PropertyList list) throws Exception {
 		MetaType metaType = pValue.getMetaType();
-		Map<String, T> unwrappedvalue = null;
+		MapCompositeValueSupport unwrappedvalueMap = null;
 		if (metaType.isComposite()) {
-			unwrappedvalue = (Map<String, T>) MetaValueFactory	.getInstance().unwrap(pValue);
+			unwrappedvalueMap = (MapCompositeValueSupport) pValue;
 
-			for (String key : unwrappedvalue.keySet()) {
+			for (String key : unwrappedvalueMap.getMetaType().keySet()) {
 				map = new PropertyMap("property");
 				map.put(new PropertySimple("name", key));
-				map.put(new PropertySimple("value", unwrappedvalue.get(key)));
+				map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalueMap.get(key))));
 				map.put(new PropertySimple("description", "Custom property"));
 				list.add(map);
 			}

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/TranslatorDiscoveryComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -22,7 +22,6 @@
 package org.teiid.rhq.plugin;
 
 import java.util.HashSet;
-import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
@@ -31,8 +30,8 @@
 import org.jboss.managed.api.ManagedComponent;
 import org.jboss.managed.api.ManagedProperty;
 import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.values.MapCompositeValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertyList;
 import org.rhq.core.domain.configuration.PropertyMap;
@@ -115,17 +114,16 @@
 
 
 	public static <T> void getTranslatorValues(MetaValue pValue,
-			PropertyMap map, PropertyList list) {
+			PropertyMap map, PropertyList list) throws Exception {
 		MetaType metaType = pValue.getMetaType();
-		Map<String, T> unwrappedvalue = null;
+		MapCompositeValueSupport unwrappedvalue = null;
 		if (metaType.isComposite()) {
-			unwrappedvalue = (Map<String, T>) MetaValueFactory.getInstance().unwrap(pValue);
+			unwrappedvalue = (MapCompositeValueSupport)pValue;
 
-			for (String key : unwrappedvalue.keySet()) {
+			for (String key : unwrappedvalue.getMetaType().keySet()) {
 				map = new PropertyMap("properties");//$NON-NLS-1$
 				map.put(new PropertySimple("name", key));//$NON-NLS-1$
-				map.put(new PropertySimple("value", unwrappedvalue.get(key)));//$NON-NLS-1$
-				//map.put(new PropertySimple("description", "Custom property"));
+				map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalue.get(key))));//$NON-NLS-1$
 				list.add(map);
 			}
 		} else {

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -47,7 +47,6 @@
 import org.jboss.metatype.api.values.GenericValue;
 import org.jboss.metatype.api.values.GenericValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
 import org.jboss.metatype.api.values.SimpleValue;
 import org.jboss.metatype.api.values.SimpleValueSupport;
 import org.mc4j.ems.connection.EmsConnection;
@@ -65,11 +64,8 @@
 import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
 import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
 import org.rhq.core.pluginapi.inventory.CreateResourceReport;
-import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
-import org.rhq.core.pluginapi.inventory.ResourceComponent;
 import org.rhq.core.pluginapi.inventory.ResourceContext;
 import org.rhq.plugins.jbossas5.connection.ProfileServiceConnection;
-import org.teiid.adminapi.impl.PropertyMetadata;
 import org.teiid.rhq.admin.DQPManagementView;
 import org.teiid.rhq.plugin.util.PluginConstants;
 import org.teiid.rhq.plugin.util.ProfileServiceUtil;
@@ -109,7 +105,7 @@
 				null));
 		String version = VDB.VERSION;
 		valueMap.put(version, this.resourceConfiguration.getSimpleValue(
-				"version", null));
+				VDB.VERSION, null));
 
 		// Parameter logic for VDB Operations
 		if (name.equals(VDB.Operations.KILL_REQUEST)) {
@@ -117,6 +113,9 @@
 					Operation.Value.REQUEST_ID).getLongValue());
 			valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
 					Operation.Value.SESSION_ID).getLongValue());
+		} else if (name.equals(VDB.Operations.CLEAR_CACHE)) {
+				valueMap.put(Operation.Value.CACHE_TYPE, configuration.getSimple(
+					Operation.Value.CACHE_TYPE).getStringValue());
 		} else if (name.equals(Platform.Operations.KILL_SESSION)) {
 			valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
 					Operation.Value.SESSION_ID).getLongValue());
@@ -124,12 +123,15 @@
 			valueMap.put(Operation.Value.SESSION_ID, configuration.getSimple(
 					Operation.Value.SESSION_ID).getLongValue());
 		} else if (name.equals(VDB.Operations.RELOAD_MATVIEW)) {
-			valueMap.put(Operation.Value.MATVIEW_SCHEMA, configuration.getSimple(
-					Operation.Value.MATVIEW_SCHEMA).getStringValue());
-			valueMap.put(Operation.Value.MATVIEW_TABLE, configuration.getSimple(
-					Operation.Value.MATVIEW_TABLE).getStringValue());
-			valueMap.put(Operation.Value.INVALIDATE_MATVIEW, configuration.getSimple(
-					Operation.Value.INVALIDATE_MATVIEW).getBooleanValue());
+			valueMap
+					.put(Operation.Value.MATVIEW_SCHEMA, configuration
+							.getSimple(Operation.Value.MATVIEW_SCHEMA)
+							.getStringValue());
+			valueMap.put(Operation.Value.MATVIEW_TABLE, configuration
+					.getSimple(Operation.Value.MATVIEW_TABLE).getStringValue());
+			valueMap.put(Operation.Value.INVALIDATE_MATVIEW, configuration
+					.getSimple(Operation.Value.INVALIDATE_MATVIEW)
+					.getBooleanValue());
 		}
 	}
 
@@ -276,9 +278,6 @@
 			managementView = getConnection().getManagementView();
 			managedComponent = managementView.getComponent(this.name,
 					componentType);
-			ManagedProperty mp = managedComponent.getProperty("models");//$NON-NLS-1$
-			List<ManagedObject> modelsMp = (List<ManagedObject>) MetaValueFactory
-					.getInstance().unwrap(mp.getValue());
 			modelsMetaValue = (CollectionValueSupport) managedComponent
 					.getProperty("models").getValue();
 			GenericValue[] models = (GenericValue[]) modelsMetaValue
@@ -301,37 +300,53 @@
 							.get("sourceName")).getStringValue(); //$NON-NLS-1$
 					if (sourceName.equals("See below"))
 						continue; // This is a multisource model which we will
-					// handle separately
+									// handle separately
 					String modelName = ((PropertySimple) model.get("name")) //$NON-NLS-1$
 							.getStringValue();
 					String dsName = ((PropertySimple) model.get("jndiName")) //$NON-NLS-1$
 							.getStringValue();
 
 					ManagedObject managedModel = null;
-					if (models != null && !modelsMp.isEmpty()) {
-						for (ManagedObject mo : modelsMp) {
+					if (models != null && models.length != 0) {
+						for (GenericValue genValue : models) {
+							ManagedObject mo = (ManagedObject) ((GenericValueSupport) genValue)
+									.getValue();
 							String name = ProfileServiceUtil.getSimpleValue(mo,
 									"name", String.class); //$NON-NLS-1$
 							if (modelName.equals(name)) {
 								managedModel = mo;
+								break;
 							}
 						}
 					}
-					ManagedProperty sourceMappings = managedModel
-							.getProperty("sourceMappings");//$NON-NLS-1$
-					if (sourceMappings != null) {
-						List<ManagedObject> mappings = (List<ManagedObject>) MetaValueFactory
-								.getInstance()
-								.unwrap(sourceMappings.getValue());
-						for (ManagedObject mo : mappings) {
-							String sName = ProfileServiceUtil.getSimpleValue(
-									mo, "name", String.class);//$NON-NLS-1$
-							if (sName.equals(sourceName)) {
-								// set the jndi name for the ds.
-								ManagedProperty jndiProperty = mo
-										.getProperty("connectionJndiName"); //$NON-NLS-1$
-								jndiProperty.setValue(ProfileServiceUtil.wrap(
-										SimpleMetaType.STRING, dsName));
+
+					ManagedProperty sourceMappings = null;
+					if (managedModel != null) {
+
+						sourceMappings = managedModel
+								.getProperty("sourceMappings");//$NON-NLS-1$
+
+						if (sourceMappings != null) {
+							CollectionValueSupport mappings = (CollectionValueSupport) sourceMappings
+									.getValue();
+							GenericValue[] mappingsArray = (GenericValue[]) mappings
+									.getElements();
+							for (GenericValue sourceGenValue : mappingsArray) {
+								ManagedObject sourceMo = (ManagedObject) ((GenericValueSupport) sourceGenValue)
+										.getValue();
+								String sName = ProfileServiceUtil
+										.getSimpleValue(sourceMo,
+												"name", String.class);//$NON-NLS-1$
+								if (sName.equals(sourceName)) {
+									// set the jndi name for the ds.
+									ManagedProperty jndiProperty = sourceMo
+											.getProperty("connectionJndiName"); //$NON-NLS-1$
+									jndiProperty
+											.setValue(ProfileServiceUtil.wrap(
+													SimpleMetaType.STRING,
+													dsName));
+									break;
+								}
 							}
 						}
 					}
@@ -340,6 +355,7 @@
 
 			try {
 				managementView.updateComponent(managedComponent);
+				managementView.load();
 			} catch (Exception e) {
 				LOG.error("Unable to update component ["
 						+ managedComponent.getName() + "] of type "
@@ -396,7 +412,12 @@
 		configuration.put(new PropertySimple("url", vdbURL));
 		configuration.put(new PropertySimple("connectionType", connectionType));
 
-		getTranslators(mcVdb, configuration);
+		try {
+			getTranslators(mcVdb, configuration);
+		} catch (Exception e) {
+			final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
+			LOG.error(msg, e);
+		}
 
 		getModels(mcVdb, configuration);
 
@@ -420,8 +441,6 @@
 	private void getModels(ManagedComponent mcVdb, Configuration configuration) {
 		// Get models from VDB
 		ManagedProperty property = mcVdb.getProperty("models");
-		List<ManagedObject> models = (List<ManagedObject>) MetaValueFactory
-				.getInstance().unwrap(property.getValue());
 		CollectionValueSupport valueSupport = (CollectionValueSupport) property
 				.getValue();
 		MetaValue[] metaValues = valueSupport.getElements();
@@ -582,17 +601,15 @@
 	/**
 	 * @param mcVdb
 	 * @param configuration
-	 * @throws Exception
+	 * @throws Exception 
 	 */
 	private void getTranslators(ManagedComponent mcVdb,
-			Configuration configuration) {
+			Configuration configuration) throws Exception {
 		// Get models from VDB
 		ManagedProperty property = mcVdb.getProperty("overrideTranslators");
 		if (property == null) {
 			return;
 		}
-		List<ManagedObject> translators = (List<ManagedObject>) MetaValueFactory
-				.getInstance().unwrap(property.getValue());
 		CollectionValueSupport valueSupport = (CollectionValueSupport) property
 				.getValue();
 		MetaValue[] metaValues = valueSupport.getElements();
@@ -612,11 +629,15 @@
 			ManagedProperty properties = managedObject.getProperty("property");
 
 			if (properties != null) {
-				List<PropertyMetadata> props = (List<PropertyMetadata>) MetaValueFactory
-						.getInstance().unwrap(properties.getValue());
-				for (PropertyMetadata propertyMetaData : props) {
-					String propertyName = propertyMetaData.getName();
-					String propertyValue = propertyMetaData.getValue();
+				CollectionValueSupport props = (CollectionValueSupport) properties
+						.getValue();
+				for (MetaValue propertyMetaData : props) {
+					String propertyName = ProfileServiceUtil
+							.stringValue(((CompositeValueSupport) propertyMetaData)
+									.get("name"));
+					String propertyValue = ProfileServiceUtil
+							.stringValue(((CompositeValueSupport) propertyMetaData)
+									.get("value"));
 					PropertyMap translatorMap = null;
 
 					translatorMap = new PropertyMap("translatorMap",

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/VDBDiscoveryComponent.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -28,6 +28,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.jboss.managed.api.ComponentType;
 import org.jboss.managed.api.ManagedComponent;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.metatype.api.values.CollectionValueSupport;
+import org.jboss.metatype.api.values.GenericValueSupport;
+import org.jboss.metatype.api.values.MetaValue;
 import org.rhq.core.domain.configuration.Configuration;
 import org.rhq.core.domain.configuration.PropertySimple;
 import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
@@ -58,9 +62,35 @@
 				.getManagedComponents(connection, new ComponentType(
 						PluginConstants.ComponentType.VDB.TYPE,
 						PluginConstants.ComponentType.VDB.SUBTYPE));
-
+		
+		PropertySimple displayPreviewVdbs = ((PlatformComponent)discoveryContext.getParentResourceComponent()).getResourceConfiguration().getSimple("displayPreviewVDBS");
+		
 		for (ManagedComponent mcVdb : vdbs) {
 
+			boolean skipVdb = false;
+			if (!displayPreviewVdbs.getBooleanValue()){
+				MetaValue[] propsArray = ((CollectionValueSupport)mcVdb.getProperty("JAXBProperties").getValue()).getElements();
+				String isPreview = "false";
+				
+				for (MetaValue propertyMetaData : propsArray) {
+					GenericValueSupport genValueSupport = (GenericValueSupport) propertyMetaData;
+					ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
+							.getValue();
+	
+					String propertyName = ProfileServiceUtil.getSimpleValue(
+							managedObject, "name", String.class);
+					if (propertyName.equals("preview")){
+						isPreview =ProfileServiceUtil.getSimpleValue(
+								managedObject, "value", String.class);
+						if (Boolean.valueOf(isPreview)) skipVdb=true;
+						break;
+					}
+				}	
+			}
+				
+			//If this is a Preview VDB and displayPreviewVdbs is false, skip this VDB
+			if (skipVdb) continue;
+				
 			String vdbKey = (String)mcVdb.getName();
 			String vdbName = vdbKey;
 			String fullName = ProfileServiceUtil.getSimpleValue(mcVdb, "fullName",

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/api/PropertyAdapterFactory.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/api/PropertyAdapterFactory.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/api/PropertyAdapterFactory.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -28,7 +28,6 @@
 import org.jboss.metatype.api.types.PropertiesMetaType;
 import org.jboss.metatype.api.values.MetaValue;
 import org.rhq.core.domain.configuration.PropertySimple;
-import org.teiid.rhq.plugin.adapter.impl.PropertyListToArrayValueAdapter;
 import org.teiid.rhq.plugin.adapter.impl.PropertyListToCollectionValueAdapter;
 import org.teiid.rhq.plugin.adapter.impl.PropertyMapToCompositeValueSupportAdapter;
 import org.teiid.rhq.plugin.adapter.impl.PropertyMapToGenericValueAdapter;
@@ -85,10 +84,6 @@
         {
             propertyAdapter = new PropertyListToCollectionValueAdapter();
         }
-        else if (metaType.isArray())
-        {
-            propertyAdapter = new PropertyListToArrayValueAdapter();
-        }
         else if (metaType.isEnum())
         {
             propertyAdapter = new PropertySimpleToEnumValueAdapter();

Deleted: trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/impl/PropertyListToArrayValueAdapter.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/impl/PropertyListToArrayValueAdapter.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/adapter/impl/PropertyListToArrayValueAdapter.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.rhq.plugin.adapter.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.rhq.core.domain.configuration.Property;
-import org.rhq.core.domain.configuration.PropertyList;
-import org.rhq.core.domain.configuration.definition.PropertyDefinition;
-import org.rhq.core.domain.configuration.definition.PropertyDefinitionList;
-import org.teiid.rhq.plugin.adapter.api.AbstractPropertyListAdapter;
-import org.teiid.rhq.plugin.adapter.api.PropertyAdapter;
-import org.teiid.rhq.plugin.adapter.api.PropertyAdapterFactory;
-
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.values.ArrayValueSupport;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-
-/**
- * 
- */
-public class PropertyListToArrayValueAdapter extends AbstractPropertyListAdapter implements PropertyAdapter<PropertyList, PropertyDefinitionList>
-{
-    //@todo need to implement this like the other List to Collection, but not until there is an actual property that needs this
-    public void populateMetaValueFromProperty(PropertyList property, MetaValue metaValue, PropertyDefinitionList propertyDefinition)
-    {
-        PropertyDefinition memberDefinition = propertyDefinition.getMemberDefinition();
-        List<Property> properties = property.getList();
-        if (metaValue != null)
-        {
-            ArrayValueSupport valueSupport = (ArrayValueSupport)metaValue;
-            MetaType listMetaType = valueSupport.getMetaType().getElementType();
-            List<MetaValue> values = new ArrayList<MetaValue>(properties.size());
-            for (Property propertyWithinList : properties)
-            {
-                MetaValue value = MetaValueFactory.getInstance().create(null);
-                PropertyAdapter<Property, PropertyDefinition> propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(listMetaType);
-                propertyAdapter.populateMetaValueFromProperty(propertyWithinList, value, memberDefinition);
-                values.add(value);
-            }
-            valueSupport.setValue(values.toArray());
-        }
-    }
-
-    //@todo need to implement this like the other List to Collection, but not until there is an actual property that needs this
-    public MetaValue convertToMetaValue(PropertyList property, PropertyDefinitionList propertyDefinition, MetaType type)
-    {
-        return null;
-    }
-
-    public void populatePropertyFromMetaValue(PropertyList property, MetaValue metaValue, PropertyDefinitionList propertyDefinition)
-    {
-        PropertyDefinition memberDefinition = propertyDefinition.getMemberDefinition();
-        List<Property> properties = property.getList();
-
-        // Since we want to load the PropertyList with fresh values, we want it cleared out
-        properties.clear();
-
-        if (metaValue != null)
-        {
-            ArrayValueSupport valueSupport = (ArrayValueSupport)metaValue;
-            MetaType listMetaType = valueSupport.getMetaType().getElementType();
-            MetaValue[] metaValues = (MetaValue[])valueSupport.getValue();
-            PropertyAdapter propertyAdapter = PropertyAdapterFactory.getPropertyAdapter(listMetaType);
-            for (MetaValue value : metaValues)
-            {
-                Property propertyToAddToList = propertyAdapter.convertToProperty(value, memberDefinition);
-                properties.add(propertyToAddToList);
-            }
-        }
-    }
-}

Modified: trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java
===================================================================
--- trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/java/org/teiid/rhq/plugin/util/PluginConstants.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -98,6 +98,7 @@
 			public static interface Operations {
 
 				public final static String GET_QUERIES = "listQueries"; //$NON-NLS-1$	
+				public final static String CLEAR_CACHE = "clearCache"; //$NON-NLS-1$	
 				public final static String EXECUTE_QUERIES = "executeQuery"; //$NON-NLS-1$
 				public final static String GET_LONGRUNNINGQUERIES = "getLongRunningRequests"; //$NON-NLS-1$
 				public final static String KILL_REQUEST = "cancelRequest"; //$NON-NLS-1$
@@ -253,6 +254,7 @@
 			public final static String MATVIEW_SCHEMA = "schema"; //$NON-NLS-1$
 			public final static String MATVIEW_TABLE = "table"; //$NON-NLS-1$
 			public final static String INVALIDATE_MATVIEW = "invalidate"; //$NON-NLS-1$
+			public final static String CACHE_TYPE = "cacheType"; //$NON-NLS-1$
 
 		}
 

Modified: trunk/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/main/resources/META-INF/rhq-plugin.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/console/src/main/resources/META-INF/rhq-plugin.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -296,11 +296,18 @@
 			property="QUERY_SERVICE_RESULT_SET_CACHE.requestCount" description="Total number of requests made against cache" />
 
 		<resource-configuration>
+		    <c:group name="SessionSettings" displayName="Settings for the Data Services plugin. Will be reset with a server restart."
+				hiddenByDefault="false">
+				<c:simple-property name="displayPreviewVDBS" displayName="Display Preview VDBs"
+					description="If 'Yes', Preview VDBs (created by the Teiid Designer) will display in the Virtual Database resource grouping. The default is 'No'"
+					required="true" readOnly="false" type="boolean" default="true"  />
+			</c:group>
+			
 			<c:group name="RuntimeEngineDeployer" displayName="Runtime Engine Properties (restart required before modifications take effect)"
 				hiddenByDefault="false">
 				<c:simple-property name="RuntimeEngineDeployer.maxRowsFetchSize"
 					displayName="Max Rows Fetch Size"
-					description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)"
+					description="Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)"
 					required="false" readOnly="false" />
 				<c:simple-property name="RuntimeEngineDeployer.maxThreads" displayName="Max Threads"
 					description="Process pool maximum thread count. (default 64)"
@@ -319,7 +326,7 @@
 					required="false" readOnly="false" />				
 				<c:simple-property name="RuntimeEngineDeployer.preparedPlanCacheMaxCount"
 					displayName="Prepared Plan Cache Max Count"
-					description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250)"
+					description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 512)"
 					required="false" readOnly="false" />
 				<c:simple-property name="RuntimeEngineDeployer.queryThresholdInSecs"
 					displayName="Long Running Query Threshold"
@@ -526,7 +533,26 @@
 						type="string" description="Result of refresh" />
 				</results>
 			</operation>
+			
+			<operation name="clearCache" displayName="Clear Cache"
+				description="Clears the cache for a given type for this VDB">
+				<parameters>
+					<c:simple-property displayName="Cache Type"
+						name="cacheType" type="string" required="true"
+						description="The cache type to clear" default="QUERY_SERVICE_RESULT_SET_CACHE">
+						<c:property-options>
+							<c:option value="QUERY_SERVICE_RESULT_SET_CACHE" default="true" name="Result Set" />
+							<c:option value="PREPARED_PLAN_CACHE" name="Prepared Plan" />
+						</c:property-options>
+					</c:simple-property>	
+				</parameters>
 
+				<results>
+					<c:simple-property displayName="Result" name="operationResult"
+						type="string" description="Result of clear cache" />
+				</results>
+			</operation>
+
 			<metric displayName="Status" defaultOn="true" dataType="trait"
 				displayType="summary" category="availability" property="status"
 				description="The status of this VDB" />
@@ -599,12 +625,12 @@
 								description="Name of the model" required="true" readOnly="true" />
 							<c:simple-property name="sourceName"
 								displayName="Source Name" description="Source name for this model"
-								required="false" readOnly="true" />
+								required="true" readOnly="true" />
 							<c:simple-property name="translatorName"
 								displayName="Translator Name" description="Name of the translator"
-								required="false" readOnly="true" />
+								required="true" readOnly="true" />
 							<c:simple-property name="jndiName" displayName="Connection JNDI Name"
-								description="JNDI name for this connection" required="false" />
+								description="JNDI name for this connection" required="true" />
 							<c:simple-property name="visibility"
 								displayName="Visible" description="Visibility of the model"
 								required="true" type="boolean" readOnly="true">
@@ -616,7 +642,7 @@
 						</c:map-property>
 					</c:list-property>
 
-					<c:list-property name="multiSourceModels"
+					<c:list-property name="multiSourceModels" readOnly="true"
 						description="The multi-source model sources for this VDB">
 						<c:map-property name="map" readOnly="false">
 							<c:simple-property name="name" displayName="Name"
@@ -626,9 +652,9 @@
 								readOnly="true" />
 							<c:simple-property name="translatorName"
 								displayName="Translator Name" description="Name of the translator"
-								required="true" />
+								readOnly="true" />
 							<c:simple-property name="jndiName" displayName="Connection JNDI Name"
-								description="JNDI name for this connection" required="false" />
+								description="JNDI name for this connection" required="true" />
 						</c:map-property>
 					</c:list-property>
 

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -613,6 +613,7 @@
 	        variables without using a lot of conditional logic.</para>
 	        <section>
 	          <title>HAS CRITERIA</title>
+	          <warning><para>HAS CRITERIA has been deprecated.  An alternative approach to update procedures will be introduced in a subsequent version.</para></warning>
 	          <para>You can use the HAS CRITERIA clause to check whether the user’s command has a particular kind of criteria on a particular set of attributes. This clause evaluates to either true or false. You can use it anywhere you can use a criteria within a procedure.</para>
 	          <para>
 	            Usage:
@@ -633,6 +634,7 @@
 	              </para>
 	            </listitem>
 	          </itemizedlist>
+	          <para>Each unoptimized conjunct of the user criteria is evaluated against the criteria selector.  If any conjunct matches then HAS CRITERIA evaluates to TRUE.  The use of OR or NOT will prevent contained predicates from matching the criteria selector.</para>
 	          <para>Some samples of the HAS CRITERIA clause:</para>
 	          <informaltable>
 	            <tgroup cols="2">
@@ -668,7 +670,7 @@
 	        </section>
 	        <section>
 	          <title>TRANSLATE CRITERIA</title>
-	          <warning><para>TRANSLATE CRITERIA.  An alternative approach to update procedures will be introduced in a subsequent version.</para></warning>
+	          <warning><para>TRANSLATE CRITERIA has been deprecated.  An alternative approach to update procedures will be introduced in a subsequent version.</para></warning>
 	          <para>You can use the TRANSLATE CRITERIA clause to convert the criteria from the user application’s SQL command into the form required to interact with the target source or view tables. The TRANSLATE CRITERIA statement uses the SELECT transformation to infer the column mapping. This clause evaluates to a translated criteria that is evaluated in the context of a command.
 	          You can use these mappings either to replace the default mappings generated from the SELECT transformation or to specify a reverse expression when a virtual column is defined by an expression.</para>
 	          <para>
@@ -699,7 +701,8 @@
 	              </para>
 	            </listitem>
 	          </itemizedlist>
-	          <para>Some samples of TRANSLATE CRITERIA:</para>
+	          <para>Each unoptimized conjunct of the user criteria is translated using the criteria selector.  If a conjunct does not match the selector, it will not be translated - which effectively treats the conjunct as TRUE.  The use of OR or NOT will prevent contained predicates from matching the criteria selector.</para>
+              <para>Some samples of TRANSLATE CRITERIA:</para>
 	          <informaltable>
 	            <tgroup cols="2">
 	              <colspec colwidth="1*"/>
@@ -726,7 +729,6 @@
 	              </tbody>
 	            </tgroup>
 	          </informaltable>
-	          <note><para>If a specific predicate type or column set is specified by TRANSALATE CRITERIA, but the user criteria has predicates that do not match, then an exception will be thrown.</para></note>
 	        </section>      
 	    </section>
     </section>

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -247,6 +247,16 @@
                 </listitem>
                 <listitem>
                     <para>
+                    <emphasis>modeshape</emphasis> - for use with Modeshape 2.2.1 or later. The PATH, NAME, LOCALNODENAME, DEPTH, and SCORE functions should be accessed as pseudo-columns, e.g. "nt:base"."jcr:path". 
+                    Teiid UFDs (prefixed by JCR_) are available for CONTIANS, ISCHILDNODE, ISDESCENDENT, ISSAMENODE, REFERENCE - see the JCRFunctions.xmi.  
+                    If a selector name is needed in a JCR function, you should use the pseudo-column "jcr:path", e.g. JCR_ISCHILDNODE(foo.jcr_path, 'x/y') would become ISCHILDNODE(foo, 'x/y') in the ModeShape query.
+                    An additional pseudo-column "mode:properties" should be imported by setting the ModeShape JDBC connection property teiidsupport=true.  
+                    The column "mode:properties" should be used by the JCR_REFERENCE and other 
+                    functions that expect a .* selector name, e.g. JCR_REFERENCE(nt_base.jcr_properties) would become REFERENCE("nt:base".*) in the ModeShape query.
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
                     <emphasis>mysql</emphasis>/<emphasis>mysql5</emphasis> - for use with 
                     MySQL version 4.x and 5 or later respectively.  
                     </para>

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierTupleSource.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -211,7 +211,7 @@
 	    				results = getResults();
 	    			}
     			} catch (TranslatorException e) {
-    				exceptionOccurred(e, true);
+    				results = exceptionOccurred(e, true);
     			} catch (DataNotAvailableException e) {
     				dtm.scheduleWork(new Runnable() {
     					@Override
@@ -352,7 +352,7 @@
     	}
     }
 
-    void exceptionOccurred(TranslatorException exception, boolean removeState) throws TeiidComponentException, TeiidProcessingException {
+    AtomicResultsMessage exceptionOccurred(TranslatorException exception, boolean removeState) throws TeiidComponentException, TeiidProcessingException {
     	if (removeState) {
 			fullyCloseSource();
 		}
@@ -360,16 +360,15 @@
 			AtomicResultsMessage emptyResults = new AtomicResultsMessage(new List[0], null);
 			emptyResults.setWarnings(Arrays.asList((Exception)exception));
 			emptyResults.setFinalRow(this.rowsProcessed);
-			receiveResults(emptyResults);
-		} else {
-    		if (exception.getCause() instanceof TeiidComponentException) {
-    			throw (TeiidComponentException)exception.getCause();
-    		}
-    		if (exception.getCause() instanceof TeiidProcessingException) {
-    			throw (TeiidProcessingException)exception.getCause();
-    		}
-    		throw new TeiidProcessingException(exception);
-		}	
+			return emptyResults;
+		} 
+		if (exception.getCause() instanceof TeiidComponentException) {
+			throw (TeiidComponentException)exception.getCause();
+		}
+		if (exception.getCause() instanceof TeiidProcessingException) {
+			throw (TeiidProcessingException)exception.getCause();
+		}
+		throw new TeiidProcessingException(exception);
 	}
 
 	void receiveResults(AtomicResultsMessage response) {

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -180,8 +180,8 @@
 	public void clearAll(){
 		this.localCache.clear();
 		this.distributedCache.clear();
-		this.totalRequests.set(0);
-		this.cacheHit.set(0);		
+		this.totalRequests = new AtomicInteger();
+		this.cacheHit = new AtomicInteger();
 	}	
 	
 	public void clearForVDB(String vdbName, int version) {

Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -157,7 +157,6 @@
 import org.teiid.query.sql.visitor.ElementCollectorVisitor;
 import org.teiid.query.sql.visitor.EvaluatableVisitor;
 import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
-import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
 import org.teiid.query.sql.visitor.EvaluatableVisitor.EvaluationLevel;
 import org.teiid.query.util.CommandContext;
 import org.teiid.query.validator.UpdateValidator.UpdateInfo;
@@ -480,9 +479,7 @@
 		}
 
 		// collect all predicate criteria present on the user's criteria
-    	Iterator criteriaIter = PredicateCollectorVisitor.getPredicates(userCrit).iterator();
-    	while(criteriaIter.hasNext()) {
-    		Criteria predicateCriteria = (Criteria) criteriaIter.next();
+		for (Criteria predicateCriteria : Criteria.separateCriteriaByAnd(userCrit)) {
     		// atleast one of the hasElemnets should be on this predicate else
     		// proceed to the next predicate
 			Collection<ElementSymbol> predElmnts = ElementCollectorVisitor.getElements(predicateCriteria, true);
@@ -576,7 +573,7 @@
 		// create a clone of user's criteria that is then translated
 		Criteria userClone = (Criteria) userCriteria.clone();
 
-		translateVisitor.translate(userClone);
+		userClone = translateVisitor.translate(userClone);
 
 		// translated criteria
 		((TranslatableProcedureContainer)userCmd).addImplicitParameters(translateVisitor.getImplicitParams());
@@ -2437,7 +2434,7 @@
 			}
 			Map<ElementSymbol, ElementSymbol> symbolMap = mapping.getUpdatableViewSymbols();
 			List<ElementSymbol> mappedSymbols = new ArrayList<ElementSymbol>(insert.getVariables().size());
-			for (ElementSymbol symbol : (List<ElementSymbol>)insert.getVariables()) {
+			for (ElementSymbol symbol : insert.getVariables()) {
 				mappedSymbols.add(symbolMap.get(symbol));
 			}
 			insert.setVariables(mappedSymbols);

Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/CriteriaTranslatorVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/CriteriaTranslatorVisitor.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/CriteriaTranslatorVisitor.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -25,20 +25,20 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.Map;
 
-import org.teiid.api.exception.query.QueryValidatorException;
-import org.teiid.core.TeiidRuntimeException;
+import net.sf.saxon.query.QueryReader;
+
 import org.teiid.core.util.Assertion;
-import org.teiid.query.QueryPlugin;
+import org.teiid.query.rewriter.QueryRewriter;
+import org.teiid.query.sql.lang.AbstractSetCriteria;
 import org.teiid.query.sql.lang.BetweenCriteria;
 import org.teiid.query.sql.lang.CompareCriteria;
 import org.teiid.query.sql.lang.Criteria;
-import org.teiid.query.sql.lang.DependentSetCriteria;
 import org.teiid.query.sql.lang.IsNullCriteria;
 import org.teiid.query.sql.lang.MatchCriteria;
-import org.teiid.query.sql.lang.SetCriteria;
-import org.teiid.query.sql.navigator.PreOrderNavigator;
+import org.teiid.query.sql.navigator.DeepPostOrderNavigator;
 import org.teiid.query.sql.proc.CriteriaSelector;
 import org.teiid.query.sql.symbol.ElementSymbol;
 import org.teiid.query.sql.symbol.Expression;
@@ -49,106 +49,11 @@
  * <p> This class is used to translate criteria specified on the user's update command against
  * the virtual group, the elements on this criteria are replaced by elements on the query
  * transformation that defines the virtual group. Parts of the criteria are selectively translated
- * if a CriteriaSelector is specified, also if the user explicty defines translations for some
+ * if a CriteriaSelector is specified, also if the user explicitly defines translations for some
  * of the elements those translations override any symbol mappings.</p>
  */
 public class CriteriaTranslatorVisitor extends ExpressionMappingVisitor {
 	
-	class CriteriaTranslatorNavigator extends PreOrderNavigator {
-
-		public CriteriaTranslatorNavigator() {
-			super(CriteriaTranslatorVisitor.this);
-		}
-		
-	    /**
-	     * <p> This method updates the <code>BetweenCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions.</p>
-	     * @param obj The BetweenCriteria object to be updated with translated expressions
-	     */
-	    public void visit(BetweenCriteria obj) {
-	        if (!selectorContainsCriteriaElements(obj, CriteriaSelector.BETWEEN)) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$ 
-	        }
-	        super.visit(obj);
-	    }
-	    
-	    /**
-	     * <p> This method updates the <code>CompareCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions.</p>
-	     * @param obj The CompareCriteria object to be updated with translated expressions
-	     */
-	    public void visit(CompareCriteria obj) {
-	        
-	        if (!selectorContainsCriteriaElements(obj, obj.getOperator())) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$ 
-	        }
-
-	        super.visit(obj);
-	    }
-
-	    /**
-	     * <p> This method updates the <code>IsNullCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions.</p>
-	     * @param obj The IsNullCriteria object to be updated with translated expressions
-	     */
-	    public void visit(IsNullCriteria obj) {
-
-	        if (!selectorContainsCriteriaElements(obj, CriteriaSelector.IS_NULL)) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$ 
-	        }
-	        super.visit(obj);
-	    }
-
-	    /**
-	     * <p> This method updates the <code>MatchCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions</p>
-	     * @param obj The SetCriteria object to be updated with translated expressions
-	     */
-	    public void visit(MatchCriteria obj) {
-	        
-	        if (!selectorContainsCriteriaElements(obj, CriteriaSelector.LIKE)) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$ 
-	        }
-
-	        super.visit(obj);
-	    }
-	    
-	    /**
-	     * <p> This method updates the <code>SetCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions</p>
-	     * @param obj The SetCriteria object to be updated with translated expressions
-	     */
-	    public void visit(SetCriteria obj) {
-	        
-	        if (!selectorContainsCriteriaElements(obj, CriteriaSelector.IN)) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$
-	        }
-	        
-	        super.visit(obj);
-	    }
-
-	    /**
-	     * <p> This method updates the <code>SetCriteria</code> object it receives as an
-	     * argument by replacing the virtual elements present in the expressions in the
-	     * function with translated expressions</p>
-	     * @param obj The SetCriteria object to be updated with translated expressions
-	     */
-	    public void visit(DependentSetCriteria obj) {
-	        
-	        if (!selectorContainsCriteriaElements(obj, CriteriaSelector.IN)) {
-	        	throw new TeiidRuntimeException(new QueryValidatorException(QueryPlugin.Util.getString("Translate.error", obj, selector))); //$NON-NLS-1$
-	        }
-	        
-	        super.visit(obj);
-	    }
-		
-	}
-
 	// criteria selector specified on the TranslateCriteria obj
 	private CriteriaSelector selector;
 
@@ -158,13 +63,6 @@
 	private Map<ElementSymbol, Reference> implicitParams = new HashMap<ElementSymbol, Reference>();
 
     /**
-     * <p> This constructor initialises the visitor</p>
-     */
-    public CriteriaTranslatorVisitor() {
-    	this(null);
-    }
-
-    /**
      * <p> This constructor initializes this object by setting the symbolMap.</p>
      * @param symbolMap A map of virtual elements to their counterparts in transform
      * defining the virtual group
@@ -251,13 +149,39 @@
 		return implicitParams;
 	}
     
-    public void translate(Criteria crit) throws QueryValidatorException {
-    	CriteriaTranslatorNavigator nav = new CriteriaTranslatorNavigator();
-    	try {
-    		crit.acceptVisitor(nav);
-    	} catch (TeiidRuntimeException e) {
-    		throw (QueryValidatorException)e.getCause();
+    public Criteria translate(Criteria crit) {
+    	LinkedList<Criteria> crits = new LinkedList<Criteria>();
+    	for (Criteria conjunct : Criteria.separateCriteriaByAnd(crit)) {
+			if (conjunct instanceof BetweenCriteria) {
+				if (!selectorContainsCriteriaElements(conjunct, CriteriaSelector.BETWEEN)) {
+					continue;
+		        }
+			} else if (conjunct instanceof CompareCriteria) {
+		        if (!selectorContainsCriteriaElements(conjunct, ((CompareCriteria)conjunct).getOperator())) {
+		        	continue; 
+		        }
+			} else if (conjunct instanceof IsNullCriteria) {
+		        if (!selectorContainsCriteriaElements(conjunct, CriteriaSelector.IS_NULL)) {
+		        	continue; 
+		        }
+			} else if (conjunct instanceof MatchCriteria) {
+		        if (!selectorContainsCriteriaElements(conjunct, CriteriaSelector.LIKE)) {
+		        	continue; 
+		        }
+			} else if (conjunct instanceof AbstractSetCriteria) {
+		        if (!selectorContainsCriteriaElements(conjunct, CriteriaSelector.IN)) {
+		        	continue;
+		        }
+			} else if (!selectorContainsCriteriaElements(conjunct, CriteriaSelector.NO_TYPE)) {
+	        	continue;
+			}
+			DeepPostOrderNavigator.doVisit(conjunct, this);
+			crits.add(conjunct);
+		}
+    	if (crits.isEmpty()) {
+    		return QueryRewriter.TRUE_CRITERIA;
     	}
+    	return Criteria.combineCriteria(crits);
     }
     
 }

Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -76,7 +76,6 @@
 import org.teiid.query.sql.lang.Option;
 import org.teiid.query.sql.lang.OrderBy;
 import org.teiid.query.sql.lang.OrderByItem;
-import org.teiid.query.sql.lang.ProcedureContainer;
 import org.teiid.query.sql.lang.Query;
 import org.teiid.query.sql.lang.QueryCommand;
 import org.teiid.query.sql.lang.SPParameter;
@@ -134,6 +133,7 @@
 import org.teiid.query.sql.visitor.EvaluatableVisitor;
 import org.teiid.query.sql.visitor.FunctionCollectorVisitor;
 import org.teiid.query.sql.visitor.GroupCollectorVisitor;
+import org.teiid.query.sql.visitor.GroupsUsedByElementsVisitor;
 import org.teiid.query.sql.visitor.PredicateCollectorVisitor;
 import org.teiid.query.sql.visitor.SQLStringVisitor;
 import org.teiid.query.sql.visitor.ValueIteratorProviderCollectorVisitor;
@@ -203,23 +203,8 @@
     	validateNoXMLUpdates(obj);
         GroupSymbol group = obj.getGroup();
         validateGroupSupportsUpdate(group);
-        Criteria crit = obj.getCriteria();
-    	validateVirtualUpdate(obj, crit);
     }
 
-	private void validateVirtualUpdate(ProcedureContainer container, 
-			Criteria crit) {
-		if (crit == null || container.getUpdateInfo() == null) {
-			return; 
-		}
-		if ((container.getType() == Command.TYPE_UPDATE && container.getUpdateInfo().getUpdateType() == UpdateType.UPDATE_PROCEDURE) 
-				|| (container.getType() == Command.TYPE_DELETE && container.getUpdateInfo().getDeleteType() == UpdateType.UPDATE_PROCEDURE)) {
-			if (!ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(crit).isEmpty()) {
-				handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.virtual_update_subquery"), crit); //$NON-NLS-1$
-			}
-		}
-	}
-
     public void visit(GroupBy obj) {
     	// Get list of all group by IDs
         List groupBySymbols = obj.getSymbols();
@@ -333,7 +318,6 @@
         validateNoXMLUpdates(obj);
         validateGroupSupportsUpdate(obj.getGroup());
         validateUpdate(obj);
-    	validateVirtualUpdate(obj, obj.getCriteria());
     }
 
     public void visit(Into obj) {
@@ -620,16 +604,10 @@
 		}
 
     	Collection transleElmnts = ElementCollectorVisitor.getElements(obj, true);
-    	Collection groups = GroupCollectorVisitor.getGroups(this.currentCommand, true);
+    	Collection<GroupSymbol> groups = GroupCollectorVisitor.getGroups(this.currentCommand, true);
 		int selectType = obj.getSelector().getSelectorType();
 
-		Collection predicates = PredicateCollectorVisitor.getPredicates(userCrit);
-		if (predicates.size() != Criteria.separateCriteriaByAnd(userCrit).size()) {
-			handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.translated_or"), userCrit); //$NON-NLS-1$
-		}
-		Iterator critIter = predicates.iterator();
-		while(critIter.hasNext()) {
-			Criteria predCrit = (Criteria) critIter.next();
+		for (Criteria predCrit : Criteria.separateCriteriaByAnd(userCrit)) {
 			if(selectType != CriteriaSelector.NO_TYPE) {
 				if(predCrit instanceof CompareCriteria) {
 					CompareCriteria ccCrit = (CompareCriteria) predCrit;
@@ -664,16 +642,7 @@
 						handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0022", criteriaElement), criteriaElement); //$NON-NLS-1$
 		    		}
 
-		    		Iterator mapElmntIter = ElementCollectorVisitor.getElements(mappedExpr, true).iterator();
-			    	boolean groupMatch = false;
-			    	while(mapElmntIter.hasNext()) {
-				    	ElementSymbol mapElement = (ElementSymbol) mapElmntIter.next();
-				    	GroupSymbol mapGrp = mapElement.getGroupSymbol();
-				    	if(groups.contains(mapGrp)) {
-				    		groupMatch = true;
-				    	}
-			    	}
-			    	if(!groupMatch) {
+		    		if (!groups.containsAll(GroupsUsedByElementsVisitor.getGroups(mappedExpr))) {
 						handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0023", criteriaElement), criteriaElement); //$NON-NLS-1$
 			    	}
 				}
@@ -1473,7 +1442,7 @@
     	validateSubquery(obj);
     }
 
-    //TODO: it may be simpler to catch this in the parser
+    //TODO: it may be simplier to catch this in the parser
     private void validateSubquery(SubqueryContainer subQuery) {
     	if (subQuery.getCommand() instanceof Query && ((Query)subQuery.getCommand()).getInto() != null) {
         	handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.subquery_insert"), subQuery.getCommand()); //$NON-NLS-1$

Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties	2010-12-13 22:02:28 UTC (rev 2774)
@@ -195,10 +195,8 @@
 ValidationVisitor.expression_requires_name = Non-column expressions require a name in XMLATTRIBUTES, XMLFOREST, QUERYSTRING, or TEXTAGG with HEADER
 ValidationVisitor.invalid_lookup_key=Expressions of type OBJECT, CLOB, BLOB, or XML cannot be used as LOOKUP key columns: {0}.
 ValidationVisitor.limit_not_valid_for_xml=The limit clause cannot be used on an XML document query.
-ValidationVisitor.translated_or=Translated user criteria must not contain OR criteria
 ValidationVisitor.union_insert = Select into is not allowed under a set operation: {0}.
 ValidationVisitor.multisource_insert = A multi-source table, {0}, cannot be used in an INSERT with query expression or SELECT INTO statement.
-ValidationVisitor.virtual_update_subquery = Subqueries are not allowed in the criteria for a virtual UPDATE/DELETE: {0}
 ValidationVisitor.invalid_encoding = Invalid encoding: {0}.
 ValidationVisitor.nonUpdatable = The specified change set {0} against an inherently updatable view does not map to a key preserving group.
 ERR.015.012.0029 = INSERT, UPDATE, and DELETE not allowed on XML documents
@@ -222,7 +220,7 @@
 ERR.015.012.0055 = Element {0} does not allow nulls.
 ERR.015.012.0059 = Left side of update expression must be an element that supports update: {0}
 ERR.015.012.0060 = Element {0} does not allow nulls.
-ERR.015.012.0061 = Views using update procedures must have update values that are constant expressiosn.  The expression ''{0}'' cannot be evaluated to a constant.
+ERR.015.012.0061 = Views using update procedures must have update values that are constant expressions.  The expression ''{0}'' cannot be evaluated to a constant.
 ERR.015.012.0062 = Elements cannot appear more than once in a SET or USING clause.  The following elements are duplicated: {0}
 ERR.015.012.0063 = Multiple failures occurred during validation:
 ERR.015.012.0064 = Validation succeeded
@@ -887,7 +885,7 @@
 RequestWorkItem.cache_nondeterministic=Caching command "{0}" at a session level, but less deterministic functions were evaluated. 
 not_found_cache=Results not found in cache
 failed_to_unwrap_connection=Failed to unwrap the source connection.
-connection_factory_not_found=Failed to the Connection Factory with JNDI name {0}. Please check the name for spelling or deploy the Connection Factory with specified name. 
+connection_factory_not_found=Failed to find the Connection Factory with JNDI name {0}. Please check the name or deploy the Connection Factory with specified name.
 
 RelationalPlanner.nonpushdown_command=Source UPDATE or DELETE command "{0}" contains non-pushdown constructs and no compensating action can be taken as the table lacks a unique key or the source does not support equality predicates . 
 

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -43,7 +43,6 @@
 import org.teiid.query.sql.lang.Command;
 import org.teiid.query.unittest.FakeMetadataFactory;
 import org.teiid.query.util.CommandContext;
-import org.teiid.translator.TranslatorException;
 
 public class TestDataTierManager {
     
@@ -125,8 +124,16 @@
     
     @Test public void testPartialResults() throws Exception {
     	helpSetup(1);
-    	info.exceptionOccurred(new TranslatorException(), true);
-    	assertNull(info.nextTuple());
+    	connectorManager.throwExceptionOnExecute = true;
+    	for (int i = 0; i < 10; i++) {
+	    	try {
+	    		assertNull(info.nextTuple());
+	    		return;
+	    	} catch (BlockedException e) {
+	    		Thread.sleep(50);
+	    	}
+    	}
+    	fail();
     }
     
     @Test public void testNoRowsException() throws Exception {

Modified: trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/test/java/org/teiid/dqp/service/AutoGenDataService.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -70,9 +70,6 @@
     @Override
     public ConnectorWork registerRequest(AtomicRequestMessage message)
     		throws TeiidComponentException {
-    	if (throwExceptionOnExecute) {
-    		throw new TeiidComponentException("Connector Exception"); //$NON-NLS-1$
-    	}
         List projectedSymbols = (message.getCommand()).getProjectedSymbols();               
         List[] results = createResults(projectedSymbols);
                 
@@ -87,6 +84,9 @@
 			
 			@Override
 			public AtomicResultsMessage execute() throws TranslatorException {
+				if (throwExceptionOnExecute) {
+		    		throw new TranslatorException("Connector Exception"); //$NON-NLS-1$
+		    	}
 				if (dataNotAvailable > -1) {
 					int delay = dataNotAvailable;
 					dataNotAvailable = -1;

Modified: trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -1246,8 +1246,7 @@
 		return procedure;
 	}
 	
-	// virtual group elements used in procedure in if statement(TRANSLATE CRITERIA)
-    @Test(expected=QueryValidatorException.class) public void testRewriteProcedure17() throws Exception {
+    @Test public void testRewriteProcedure17() throws Exception {
         String procedure = "CREATE PROCEDURE "; //$NON-NLS-1$
         procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
         procedure = procedure + "DECLARE integer var1;\n"; //$NON-NLS-1$
@@ -1397,8 +1396,7 @@
         assertEquals("Rewritten command was not expected", rewritProc, procReturned); //$NON-NLS-1$
     }
     
-	// elements being set in updates are dropped if INPUT var is not available
-    @Test(expected=QueryValidatorException.class) public void testRewriteProcedure24() throws Exception {
+    @Test public void testRewriteProcedure24() throws Exception {
         String procedure = "CREATE PROCEDURE "; //$NON-NLS-1$
         procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
         procedure = procedure + "UPDATE pm1.g1 SET e2=Input.e2 WHERE TRANSLATE LIKE CRITERIA ON (e1) WITH (e1=concat(pm1.g1.e1, '%'));\n"; //$NON-NLS-1$
@@ -1452,8 +1450,7 @@
 		assertEquals("Rewritten command was not expected", rewritProc, procReturned); //$NON-NLS-1$
 	}
 	
-	// virtual group elements used in procedure in if statement(TRANSLATE CRITERIA)
-	@Test(expected=QueryValidatorException.class) public void testRewriteProcedure27() throws Exception {
+	@Test public void testRewriteProcedure27() throws Exception {
 		String procedure = "CREATE PROCEDURE "; //$NON-NLS-1$
 		procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
 		procedure = procedure + "DECLARE integer var1;\n"; //$NON-NLS-1$

Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -689,10 +689,6 @@
         helpValidate("UPDATE test.group SET e0=1, e0=2", new String[] {"e0"}, exampleMetadata()); //$NON-NLS-1$ //$NON-NLS-2$
     }  
     
-    @Test public void testUpdateSubqueryCriteria() {
-        helpValidate("UPDATE vm1.g1 SET e1=1 WHERE exists (select * from vm1.g1)" , new String[] {"EXISTS (SELECT * FROM vm1.g1)"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-    
     @Test public void testUpdate4() throws Exception {
         QueryMetadataInterface metadata = exampleMetadata();
 
@@ -1309,21 +1305,7 @@
 		helpValidateProcedure(procedure, userQuery, 
 				FakeMetadataObject.Props.UPDATE_PROCEDURE);
 	}
-    
-    @Test public void testCreateUpdateProcedure28() {
-        String procedure = "CREATE PROCEDURE  "; //$NON-NLS-1$
-        procedure = procedure + "BEGIN\n"; //$NON-NLS-1$
-        procedure = procedure + "DECLARE integer var1;\n"; //$NON-NLS-1$
-        procedure = procedure + "Select pm1.g2.e2 from pm1.g2 where TRANSLATE CRITERIA;\n"; //$NON-NLS-1$
-        procedure = procedure + "ROWS_UPDATED =0;\n";         //$NON-NLS-1$
-        procedure = procedure + "END\n"; //$NON-NLS-1$
 
-        String userQuery = "UPDATE vm1.g3 SET x='x' where y = 1 or y = 2"; //$NON-NLS-1$
-
-		helpFailProcedure(procedure, userQuery, 
-				FakeMetadataObject.Props.UPDATE_PROCEDURE);
-	}
-
     // using aggregate function within a procedure - defect #8394
     @Test public void testCreateUpdateProcedure31() {
         String procedure = "CREATE PROCEDURE  "; //$NON-NLS-1$

Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/Admin.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -329,6 +329,17 @@
 	}
 	
 	@Override
+	public void clearCache(String cacheType, String vdbName, int version) throws AdminException{
+		try {
+			ManagedComponent mc = getView().getComponent(DQPNAME, DQPTYPE);	
+			ManagedUtil.executeOperation(mc, "clearCache", SimpleValueSupport.wrap(cacheType), //$NON-NLS-1$
+					SimpleValueSupport.wrap(vdbName), SimpleValueSupport.wrap(version));
+		} catch (Exception e) {
+			throw new AdminComponentException(e.getMessage(), e);
+		} 		
+	}
+	
+	@Override
 	public Collection<Transaction> getTransactions() throws AdminException {
 		try {
 			Collection<Transaction> txnList = new ArrayList<Transaction>();

Modified: trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/jboss-integration/src/main/java/org/teiid/adminapi/jboss/ManagedUtil.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -43,11 +43,13 @@
 import org.jboss.managed.api.ManagedCommon;
 import org.jboss.managed.api.ManagedOperation;
 import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.types.EnumMetaType;
 import org.jboss.metatype.api.types.MapCompositeMetaType;
 import org.jboss.metatype.api.types.MetaType;
 import org.jboss.metatype.api.types.SimpleMetaType;
 import org.jboss.metatype.api.values.CollectionValue;
 import org.jboss.metatype.api.values.EnumValue;
+import org.jboss.metatype.api.values.EnumValueSupport;
 import org.jboss.metatype.api.values.MapCompositeValueSupport;
 import org.jboss.metatype.api.values.MetaValue;
 import org.jboss.metatype.api.values.PropertiesMetaValue;
@@ -165,6 +167,10 @@
 		 }
 	}
 	
+	public static EnumValue wrap(EnumMetaType type, String value) {
+		return new EnumValueSupport(type, value);
+	}
+	
 	public static SimpleValue wrap(MetaType type, String value) {
 		if (type instanceof SimpleMetaType) {
 			SimpleMetaType st = (SimpleMetaType)type;

Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -426,6 +426,12 @@
 	}
 	
 	@Override
+	@ManagementOperation(description="Clear the caches in the system for a VDB", params={@ManagementParameter(name="cacheType",description="Type of Cache"), @ManagementParameter(name="vdbName",description="VDB Name"), at ManagementParameter(name="version",description="VDB Version")}, impact=Impact.ReadOnly)
+	public void clearCache(String cacheType, String vdbName, int version) {
+		this.dqpCore.clearCache(cacheType, vdbName, version);
+	}	
+	
+	@Override
 	@ManagementOperation(description="Get the cache statistics", impact=Impact.ReadOnly)
 	public CacheStatisticsMetadata getCacheStatistics(String cacheType) {
 		return this.dqpCore.getCacheStatistics(cacheType);

Modified: trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -80,6 +80,10 @@
 		}
 	}
 	
+	public boolean isStale(File cacheFile, long timeAfter) {
+		return (cacheFile.exists() && timeAfter > cacheFile.lastModified());
+	}
+	
 	public void removeAttachments(VFSDeploymentUnit vf) {
 		String dirName = baseDirectory(vf);
 		FileUtils.removeDirectoryAndChildren(new File(dirName));

Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -43,7 +43,6 @@
 import org.teiid.adminapi.impl.VDBMetaData;
 import org.teiid.adminapi.impl.VDBTranslatorMetaData;
 import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
-import org.teiid.core.util.FileUtils;
 import org.teiid.dqp.internal.datamgr.ConnectorManager;
 import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
 import org.teiid.dqp.internal.datamgr.TranslatorRepository;
@@ -237,7 +236,7 @@
 		deployment.setRemoved(true);
 		
 		try {
-			deleteMetadataStore((VFSDeploymentUnit)unit, deployment);
+			deleteMetadataStore((VFSDeploymentUnit)unit);
 		} catch (IOException e) {
 			LogManager.logWarning(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_delete_failed", e.getMessage())); //$NON-NLS-1$
 		}
@@ -250,18 +249,17 @@
 	}		
 	
 	private void saveMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, MetadataStoreGroup store) throws IOException {
-		File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
+		File cacheFileName = buildCachedVDBFileName(this.serializer, unit, vdb);
 		if (!cacheFileName.exists()) {
 			this.serializer.saveAttachment(cacheFileName,store);
-		}
+			LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+unit.getRoot().getName()+" metadata has been cached to "+ cacheFileName); //$NON-NLS-1$ //$NON-NLS-2$
+		}		
 	}
 	
-	private void deleteMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb) throws IOException {
+	private void deleteMetadataStore(VFSDeploymentUnit unit) throws IOException {
 		if (!unit.getRoot().exists() || !shutdownListener.isShutdownInProgress()) {
-			File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
-			if (cacheFileName.exists()) {
-				FileUtils.removeDirectoryAndChildren(cacheFileName.getParentFile());
-			}
+			this.serializer.removeAttachments(unit);
+			LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+unit.getRoot().getName()+" metadata removed"); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 	}
 	
@@ -274,7 +272,7 @@
 	    	}
 			    	
 	    	final boolean cache = "cached".equalsIgnoreCase(vdb.getPropertyValue("UseConnectorMetadata")); //$NON-NLS-1$ //$NON-NLS-2$
-	    	final File cacheFile = buildCachedFileName(unit, vdb, model.getName());
+	    	final File cacheFile = buildCachedModelFileName(unit, vdb, model.getName());
 	    	boolean loaded = false;
 	    	if (cache) {
 				MetadataStore store = this.serializer.loadSafe(cacheFile, MetadataStore.class);
@@ -347,10 +345,14 @@
     	}
     }
     
-	private File buildCachedFileName(VFSDeploymentUnit unit, VDBMetaData vdb, String modelName) {
+	private File buildCachedModelFileName(VFSDeploymentUnit unit, VDBMetaData vdb, String modelName) {
 		return this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()+"_"+modelName); //$NON-NLS-1$ //$NON-NLS-2$
 	}    
 	
+	static File buildCachedVDBFileName(ObjectSerializer serializer, VFSDeploymentUnit unit, VDBMetaData vdb) {
+		return serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
+	} 	
+	
 	public void setTranslatorRepository(TranslatorRepository repo) {
 		this.translatorRepository = repo;
 	}	

Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -142,12 +142,21 @@
 			unit.addAttachment(IndexMetadataFactory.class, imf);
 							
 			// add the cached store.
-			File cacheFile = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()); //$NON-NLS-1$
+			File cacheFile = VDBDeployer.buildCachedVDBFileName(this.serializer, unit, vdb);
+			// check to see if the vdb has been modified when server is down; if it is then clear the old files
+			if (this.serializer.isStale(cacheFile, unit.getRoot().getLastModified())) {
+				this.serializer.removeAttachments(unit);
+				LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+unit.getRoot().getName()+" old cached metadata has been removed"); //$NON-NLS-1$ //$NON-NLS-2$				
+			}
 			MetadataStoreGroup stores = this.serializer.loadSafe(cacheFile, MetadataStoreGroup.class);
-			if (stores == null) {
+			if (stores == null) {				
+				// start to build the new metadata 
 				stores = new MetadataStoreGroup();
 				stores.addStore(imf.getMetadataStore(vdbRepository.getSystemStore().getDatatypes()));
 			}
+			else {
+				LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+unit.getRoot().getName()+" has being loaded from cached metadata"); //$NON-NLS-1$ //$NON-NLS-2$
+			}
 			unit.addAttachment(MetadataStoreGroup.class, stores);				
 		}
 		

Modified: trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java
===================================================================
--- trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/runtime/src/test/java/org/teiid/transport/TestCommSockets.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -194,6 +194,9 @@
 	}
 
 	@Test public void testSSLConnectWithNonSSLServer() throws Exception {
+		//first make a non-ssl connection to ensure that it's not reused
+		SocketServerConnection conn = helpEstablishConnection(false);
+		conn.close();
 		try {
 			helpEstablishConnection(true);
 			fail("exception expected"); //$NON-NLS-1$
@@ -207,12 +210,19 @@
 		config.setMode(SSLConfiguration.ENABLED);
 		config.setAuthenticationMode(SSLConfiguration.ANONYMOUS);
 		Properties p = new Properties();
+		p.setProperty("org.teiid.sockets.soTimeout", "100");
 		helpEstablishConnection(true, config, p);
 		SocketServerConnection conn = helpEstablishConnection(true, config, p);
 		conn.close();
+		
+		try {
+			helpEstablishConnection(false, config, p);
+		} catch (CommunicationException e) {
+			
+		}
 	}
 	
-	@Test(expected=CommunicationException.class) public void testNonSSLConnectWithSSLServer() throws Exception {
+	@Test(expected=CommunicationException.class) public void testNonAnonSSLConnectWithSSLServer() throws Exception {
 		SSLConfiguration config = new SSLConfiguration();
 		config.setMode(SSLConfiguration.ENABLED);
 		config.setAuthenticationMode(SSLConfiguration.ANONYMOUS);

Modified: trunk/test-integration/db/src/assembly/binaries.xml
===================================================================
--- trunk/test-integration/db/src/assembly/binaries.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/assembly/binaries.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -29,6 +29,7 @@
 		<include>org.apache.ant:ant-launcher</include>
       	<include>ant-contrib:cpptasks</include>
 		<include>ant-contrib:ant-contrib</include>
+		<include>xerces:xercesImpl</include>
       </includes>
 
     </dependencySet>
@@ -50,6 +51,7 @@
 		<include>org.jboss.teiid:teiid-common-core</include>
 		<include>org.jboss.teiid:teiid-adminshell</include>
 		<include>org.jboss.teiid:teiid-engine</include>
+		<include>org.jboss.teiid:teiid-client</include>
 		<include>log4j:log4j</include>
 		<include>junit:junit</include>
 		<include>jdom:jdom</include>

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ExpectedResults.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ExpectedResults.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ExpectedResults.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -75,6 +75,17 @@
 	
 	
 	/**
+	 * @see TestProperties#RESULT_MODES
+	 * 
+	 * Return true if the expected results file is needed in the test.  Either
+	 * for comparison or generation.   It will return false when
+	 * the option <code>TestProperties.RESULT_MODES.NONE</code>
+	 * @return
+	 */
+	boolean isExpectedResultsNeeded();
+	
+	
+	/**
 	 * Indicates if a query expects to have an <code>Exception</code> to be thrown when the
 	 * query is executed.
 	 * @param queryidentifier

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClient.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -195,9 +195,9 @@
                      	    
                 	    // run test
                     	    try {
-                    		tc.runTransaction(userTxn);
+                    	    	tc.runTransaction(userTxn);
                     	    } catch (Throwable t) {
-                    		TestLogger.logInfo("Testcase run error: " + t.getLocalizedMessage());
+                    	    	t.printStackTrace();
                     	    }
         	             
                 	}

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClientTransaction.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClientTransaction.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TestClientTransaction.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -106,7 +106,7 @@
     @Override
     public void testCase() throws Exception {
 	TestLogger.logDebug("expected error: " + this.errorExpected);
-	TestLogger.logDebug("ID: " + query.geQuerySetID() + "-" + query.getQueryID());
+	TestLogger.logInfo("ID: " + query.geQuerySetID() + "  -  " + query.getQueryID());
         
 	QuerySQL[] queries = query.getQueries();
 	int l = queries.length;
@@ -165,20 +165,8 @@
 	rs = new TestResultStat(query.geQuerySetID(), query.getQueryID(), sql,
 		testStatus, beginTS, endTS, resultException, null);
 	
-	
-
-	System.out.println("ADD THE TEST RESULT");
-
 	this.testResultsSummary.addTestResult(query.geQuerySetID(), rs);
 
-//	
-//	try {
-//		System.out.println("HANDLE RESULT " + this.internalResultSet.isClosed());
-//	} catch (SQLException e) {
-//		// TODO Auto-generated catch block
-//		e.printStackTrace();
-//	}
-	
 	this.querySet.handleTestResult(rs, this.internalResultSet, this.updateCount, resultFromQuery, sql);
 
     }

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/TransactionFactory.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -74,7 +74,7 @@
         } 
         
        
-        TestLogger.log("====  Create Transaction-Option: " + type);
+        TestLogger.logDebug("====  Create Transaction-Option: " + type);
         
         if (type.equalsIgnoreCase(TRANSACTION_TYPES.LOCAL_TRANSACTION)) {
         	transacton = new LocalTransaction();

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/CTCQueryScenario.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -20,7 +20,6 @@
  */
 package org.teiid.test.client.ctc;
 
-import java.io.IOException;
 import java.sql.ResultSet;
 import java.util.Properties;
 
@@ -123,7 +122,7 @@
 
 	} else {
 	    // just create the error file for any failures
-	    if (tr.getStatus() == TestResult.RESULT_STATE.TEST_EXCEPTION) {
+	    if (tr.getStatus() == TestResult.RESULT_STATE.TEST_EXCEPTION && !getResultsMode().equalsIgnoreCase(TestProperties.RESULT_MODES.NONE)) {
 		try {
 		    this.getResultsGenerator().generateErrorFile(tr.getQuerySetID(),
 			    tr.getQueryID(), sql, resultSet, resultException,

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/TagNames.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/TagNames.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/TagNames.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -46,6 +46,7 @@
   private static final String DATA_ELE_TYPE_OBJECT = "object"; //$NON-NLS-1$
   private static final String DATA_ELE_TYPE_XML = "xml"; //$NON-NLS-1$
   private static final String DATA_ELE_TYPE_CLOB = "clob"; //$NON-NLS-1$
+  private static final String DATA_ELE_TYPE_BLOB = "blob"; //$NON-NLS-1$
 
     public static Map TYPE_MAP;
 
@@ -69,6 +70,7 @@
         TYPE_MAP.put(DATA_ELE_TYPE_TIMESTAMP,   java.sql.Timestamp.class);
         TYPE_MAP.put(DATA_ELE_TYPE_XML,         java.lang.String.class);
         TYPE_MAP.put(DATA_ELE_TYPE_CLOB,        java.lang.String.class);
+        TYPE_MAP.put(DATA_ELE_TYPE_BLOB,        java.lang.String.class);
     }
 
 

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLExpectedResults.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -87,7 +87,7 @@
 	validateResultsMode(this.props);
 
     	
-    	TestLogger.logInfo("Expected results loc: " + this.results_dir_loc);
+    	TestLogger.logDebug("Expected results loc: " + this.results_dir_loc);
     }
     
     protected void validateResultsMode(Properties props) {
@@ -106,9 +106,13 @@
 	}
 	// otherwise use default of NONE
 
-	TestLogger.log("\nResults mode: " + resultMode); //$NON-NLS-1$
+	TestLogger.logDebug("\nResults mode: " + resultMode); //$NON-NLS-1$
 
     }
+    
+    public boolean isExpectedResultsNeeded() {
+    	return (resultMode.equalsIgnoreCase(TestProperties.RESULT_MODES.COMPARE));
+    }
 
 
 	@Override
@@ -217,14 +221,12 @@
 			    // Convert results to ResultsHolder
  			    actualResults = new ResultsHolder(TagNames.Elements.QUERY_RESULTS);
 		    		actualResults.setQueryID(expectedResults.getQueryID());
+		    		convertResults(resultSet, batchSize,   actualResults);
 
 		      		if (expectedResults.getRows().size() > 0) {
-         			    convertResults(resultSet, batchSize,   actualResults);
         			    compareResults(actualResults, expectedResults, eMsg, isOrdered);
 		      		} else if (actualResults.getRows() != null &&  actualResults.getRows().size() > 0) {
-			                throw new QueryTestFailedException(eMsg + "Expected results indicated no results, but actual shows " + actualResults.getRows().size() + " rows."); //$NON-NLS-1$
-	      		    
-		      		    
+			                throw new QueryTestFailedException(eMsg + "Expected results indicated no results, but actual shows " + actualResults.getRows().size() + " rows."); //$NON-NLS-1$	      		    		      		    
 		      		}
 
 			    // DEBUG:
@@ -513,6 +515,10 @@
                                                            + (actualValue!=null?actualValue:"null")  + "]"); //$NON-NLS-1$
 
                 } 
+                
+                if (expectedValue == null && actualValue == null) {
+                	continue;
+                }
                 	
                 if (actualValue instanceof Blob || actualValue instanceof Clob || actualValue instanceof SQLXML) {
                     	 
@@ -773,7 +779,7 @@
 			String querySetIdentifier) throws QueryTestFailedException {
 		String resultFileName = queryIdentifier + ".xml"; //$NON-NLS-1$
 		File file = new File(results_dir_loc + "/" + querySetIdentifier, resultFileName);
-		if (!file.exists()) {
+		if (!file.exists() && this.isExpectedResultsNeeded()) {
 			throw new QueryTestFailedException("Query results file " + file.getAbsolutePath() + " cannot be found");
 		}
 		

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLGenerateResults.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLGenerateResults.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLGenerateResults.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -124,9 +124,8 @@
 	    throws QueryTestFailedException {
 
     	try {
-			System.out.println("GENERATE QRF: " + result.isClosed());
+			if (result != null ) result.isClosed();
 		} catch (SQLException e1) {
-			// TODO Auto-generated catch block
 			e1.printStackTrace();
 		}
 	File resultsFile = createNewResultsFile(queryID, querySetID,

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryVisitationStrategy.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryVisitationStrategy.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/ctc/XMLQueryVisitationStrategy.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -534,7 +534,7 @@
      */
     private Object consumeMsg(Element cellElement) throws JDOMException {
 
-        Object cellObject = null;
+        Object cellObject = null;;
         String cellName = cellElement.getName();
 
         if ( cellName.equalsIgnoreCase(TagNames.Elements.BOOLEAN) ) {
@@ -567,6 +567,8 @@
             cellObject = consumeMsg((Short) cellObject, cellElement);
         } else if ( cellName.equalsIgnoreCase(TagNames.Elements.OBJECT) ) {
             cellObject = consumeMsg((String) cellObject, cellElement);
+        } else {
+        	cellObject = consumeMsg(cellObject, cellElement);
         }
 
         return cellObject;
@@ -891,7 +893,90 @@
         }
         return result;
     }
+    
+    
+    /**
+     * Consume an XML message and update the specified Byte instance.
+     * <br>
+     * @param object the instance that is to be updated with the XML message data.
+     * @param cellElement the XML element that contains the data
+     * @return the updated instance.
+     * @exception JDOMException if there is an error consuming the message.
+     */
+    @SuppressWarnings("unused")
+	private Object consumeMsg(Object object, Element cellElement) throws JDOMException {
 
+//        // -----------------------
+//        // Process the element ...
+//        // -----------------------
+//        Byte result;
+//        try {
+//            result = new Byte(cellElement.getTextTrim());
+//        } catch ( NumberFormatException e ) {
+//            throw new JDOMException("Unable to parse the value for " + cellElement.getName() + //$NON-NLS-1$
+//                                    " element: " + cellElement.getTextTrim(), e); //$NON-NLS-1$
+//        }
+//        return result;
+        
+    	return cellElement.getText();
+        // ----------------------
+        // Create the Object element ...
+        // ----------------------
+//        Element objectElement = new Element(TagNames.Elements.OBJECT);
+//        
+//        String result = null;
+//        if (object instanceof Blob || object instanceof Clob || object instanceof SQLXML) {
+//       	 
+//        	if (object instanceof Clob){
+//        		Clob c = (Clob)object;
+//        		try {
+//        			result = ObjectConverterUtil.convertToString(c.getAsciiStream());
+//					
+//				} catch (Throwable e) {
+//					// TODO Auto-generated catch block
+//					throw new SQLException(e);
+//				}
+//        	} else if (object instanceof Blob){
+//            		Blob b = (Blob)object;
+//            		try {
+//            			result = ObjectConverterUtil.convertToString(b.getBinaryStream());
+//						
+//					} catch (Throwable e) {
+//						// TODO Auto-generated catch block
+//						throw new SQLException(e);
+//					}
+//            } else if (object instanceof SQLXML){
+//            	SQLXML s = (SQLXML)object;
+//        		try {
+//        			result = ObjectConverterUtil.convertToString(s.getBinaryStream());
+//					
+//				} catch (Throwable e) {
+//					// TODO Auto-generated catch block
+//					throw new SQLException(e);
+//				}
+//            } 
+//        } else {
+//        	result = object.toString();
+//        }
+//        
+// //       System.out.println("ProductObject (before encoding): " + object.toString() );
+// //       try {
+//            objectElement.setText(result);
+//            	//	URLEncoder.encode(object.toString(), "UTF-8"));
+// //       } catch (UnsupportedEncodingException e) {
+//            // UTF-8 is supported natively by all jvms
+// //       }
+////        System.out.println("ProductObject (after encoding): " + objectElement.getText() );
+//
+//        
+//        if ( parent != null ) {
+//            objectElement = parent.addContent(objectElement);
+//        }
+//
+//        return objectElement;
+
+    }
+
     /**
      * Consume an XML message and update the specified Long instance.
      * <br>
@@ -1242,8 +1327,7 @@
      */
     private Element produceObject(Object object, Element parent) throws JDOMException, SQLException {
 
-    	System.out.println("PRODUCT OBJECT");
-        // ----------------------
+         // ----------------------
         // Create the Object element ...
         // ----------------------
         Element objectElement = new Element(TagNames.Elements.OBJECT);
@@ -1283,14 +1367,7 @@
         	result = object.toString();
         }
         
- //       System.out.println("ProductObject (before encoding): " + object.toString() );
- //       try {
-            objectElement.setText(result);
-            	//	URLEncoder.encode(object.toString(), "UTF-8"));
- //       } catch (UnsupportedEncodingException e) {
-            // UTF-8 is supported natively by all jvms
- //       }
-//        System.out.println("ProductObject (after encoding): " + objectElement.getText() );
+         objectElement.setText(result);
 
         
         if ( parent != null ) {

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/client/impl/ExpectedResultsImpl.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/client/impl/ExpectedResultsImpl.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/client/impl/ExpectedResultsImpl.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -31,6 +31,7 @@
 
 import org.teiid.core.util.SqlUtil;
 import org.teiid.test.client.ExpectedResults;
+import org.teiid.test.client.TestProperties;
 import org.teiid.test.client.ctc.ResultsHolder;
 import org.teiid.test.framework.TestLogger;
 import org.teiid.test.framework.exception.QueryTestFailedException;
@@ -72,7 +73,13 @@
 	    throws QueryTestFailedException {
 	return false;
     }
+    
+	public boolean isExpectedResultsNeeded() {
+    	return true;
 
+	}
+
+
     @Override
     public String getQuerySetID() {
 	return this.querySetIdentifier;

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/TransactionContainer.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -30,7 +30,7 @@
 		".");
 
 	try {
-	    detail("Start transaction test: " + test.getTestName());
+	    debug("Start transaction test: " + test.getTestName());
 
 	    try {
 
@@ -50,7 +50,7 @@
 
 	    runTest(test);
 
-	    detail("Completed transaction test: " + test.getTestName());
+	    debug("Completed transaction test: " + test.getTestName());
 
 	} finally {
 	    debug("	test.cleanup");

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionStrategyFactory.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -38,15 +38,15 @@
         	        if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DRIVER_CONNECTION)) {
         	        	// pass in null to create new strategy
         	                strategy = new DriverConnection(props);
-        	                TestLogger.log("Created Driver Strategy");
+        	                TestLogger.logDebug("Created Driver Strategy");
         	        }
         	        else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.DATASOURCE_CONNECTION)) {
         	            strategy = new DataSourceConnection(props);
-        	            TestLogger.log("Created DataSource Strategy");
+        	            TestLogger.logDebug("Created DataSource Strategy");
         	        }
         	        else if (type.equalsIgnoreCase(ConfigPropertyNames.CONNECTION_TYPES.JNDI_CONNECTION)) {
         	            strategy = new JEEConnection(props);
-        	            TestLogger.log("Created JEE Strategy");
+        	            TestLogger.logDebug("Created JEE Strategy");
         	        }   
         	        
         	        if (strategy == null) {

Modified: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -184,7 +184,7 @@
 
     private void loadDataSourceMappings() throws QueryTestFailedException {
 	if (ConfigPropertyLoader.getInstance().isDataStoreDisabled()) {
-	    TestLogger.log("DataStore usage has been disabled");
+	    TestLogger.logDebug("DataStore usage has been disabled");
 	    return;
 	}
 
@@ -192,9 +192,9 @@
 	
 	if (dsloc == null || dsloc.indexOf(UNASSIGNEDDSLOC) > -1) {
 	    dsloc = DEFAULT_DATASOURCES_LOC;
-	    TestLogger.log("Using default datasource loc: " +dsloc);
+	    TestLogger.logDebug("Using default datasource loc: " +dsloc);
 	} else {
-	    TestLogger.log("Using override for datasources loc: " + dsloc);
+	    TestLogger.logDebug("Using override for datasources loc: " + dsloc);
 	}
 	
 	File[] dirs = findAllChildDirectories(dsloc);
@@ -281,7 +281,7 @@
 
 	    DataSource ds = new DataSource(datasourcedir.getName(), "dsgroup", dsprops);
 	    datasources.put(ds.getName(), ds);
-	    TestLogger.log("Loaded datasource " + ds.getName());
+	    TestLogger.logDebug("Loaded datasource " + ds.getName());
 
 	}
 

Modified: trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/ctc.xml	2010-12-13 22:02:28 UTC (rev 2774)
@@ -6,7 +6,7 @@
 	  <classpath>
 	  	<pathelement path="${maven.runtime.classpath}" />
 	  </classpath>
-	</taskdef>
+	</taskdef>
 	
 	<target name="main" depends="init, is.config.file, set.default.config.file, set.config.file" 
 		if="" unless="" description="create all property files">
@@ -36,8 +36,8 @@
 			<available file="${scenario.dir}/${scenario.file}"  />
 		</condition>
 		
-		<delete file="${ERROR_FILE}"/>
-
+		<delete file="${ERROR_FILE}"/>
+
 	</target>
 	
 	<target name="set.win"
@@ -49,13 +49,13 @@
 		   		<path location="${proj.dir}"/>
 			 </pathconvert>
 		
-		<property name="root_output" value="${proj_dir}/bulk-query-tests" />
+		<property name="root_output" value="${output.dir}" />
 
 	</target>
 	
 	<target name="set.linux"
 		if="UnixOS">
-		<property name="root_output" value="${proj.dir}/bulk-query-tests" />
+		<property name="root_output" value="${output.dir}" />
 		<property name="proj_dir" value="${proj.dir}" />
 
 	</target>
@@ -84,7 +84,7 @@
 		<property name="use.config.file" value="${config.file}" />
 		<echo>USE CONFIG: ${use.config.file}</echo>
 	
-	</target>
+	</target>
 
     <target name="run.all.test"
     		unless="single" >
@@ -143,6 +143,11 @@
 			   		 <map from="\" to="/"/>
 			   		<path location="${vdb.artifacts.dir}"/>
 				 </pathconvert>
+				 
+			<pathconvert targetos="unix" property="root.output" >
+			   		 <map from="\" to="/"/>
+			   		<path location="${root_output}"/>
+				 </pathconvert>		 
 			
 			
 			  <java classname="org.teiid.test.client.TestClient" fork="true" >
@@ -153,6 +158,9 @@
 			        </fileset>
 			    </classpath>
 			    <jvmarg value="-Xmx1024m" />
+				<!--
+				<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" />
+				-->
 			  	<jvmarg value="-Dconfig=${use.config.file}" />
 			  	<jvmarg value="-Dscenariofile=${scenario_file}" />
 			  	<jvmarg value="-Dqueryset.artifacts.dir=${queryset_artifacts_dir}" />
@@ -161,7 +169,7 @@
 				<jvmarg value="-Ddatasourceloc=${datasourceloc}" />
 				<jvmarg value="-Dserver.host.name=${server.host.name}" />   
 				<jvmarg value="-Dproj.dir=${proj_dir}" /> 
-			  	
+			  	<jvmarg value="-Doutput.dir=${root.output}" />
 
 			</java>
 
@@ -185,6 +193,9 @@
                 </fileset>
             </classpath>
             <jvmarg value="-Xmx1024m" />
+			<!--
+			<jvmarg value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y" />
+			-->
            	<jvmarg value="-Dconfig=${use.config.file}" />
           	<jvmarg value="-Dscenariofile=${scenario.file}" />
           	<jvmarg value="-Dqueryset.artifacts.dir=${queryset.artifacts.dir}" />
@@ -193,6 +204,7 @@
 			<jvmarg value="-Ddatasourceloc=${datasourceloc}" />   
 			<jvmarg value="-Dserver.host.name=${server.host.name}" />   
           	<jvmarg value="-Dproj.dir=${proj_dir}" /> 
+			<jvmarg value="-Doutput.dir=${root_output}" /> 
           	
       	  </java>
 		

Modified: trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh
===================================================================
--- trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/main/resources/ctc_tests/runclienttest.sh	2010-12-13 22:02:28 UTC (rev 2774)
@@ -14,7 +14,7 @@
 #	-	SCENARIODIR	-	directory location where the scenario files found and determine which query sets and vdbs to use, 
 #	-	DATASOURCEDIR	-	root directory location to find the various datasources to use
 #	-	CONFIGFILE	-	specify the configuration file to use (override ctc-test.properties)
-
+#	-	OUTPUTDIR -    optional, can set the location the reports and generated files will be writtent o
 ######################################################
 #	DEBUGGING OPTION
 #
@@ -84,6 +84,15 @@
 #ANT_ARGS="${ANT_ARGS} -Dvdb.artifacts.dir=${vdb.artifacts.dir}"
 ANT_ARGS="${ANT_ARGS} -Dproj.dir=${PRGDIR}"
 
+if [ -z "${OUTPUTDIR}" ] 
+	then
+	
+	OUTPUTDIR=${PRGDIR}
+
+fi
+
+ANT_ARGS="${ANT_ARGS} -Doutput.dir=${OUTPUTDIR}"
+
 # default to the ip address used to start the server
 SVRNAME="0.0.0.0"
 
@@ -133,6 +142,8 @@
 	mkdir "${PRGDIR}"/log
 fi
 
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
+
 if [ -n "${JAVA_OPTS}" ]; then
 	ANT_OPTS="${JAVA_OPTS} $ANT_OPTS "
 fi

Modified: trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java
===================================================================
--- trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java	2010-12-13 18:40:05 UTC (rev 2773)
+++ trunk/test-integration/db/src/test/java/org/teiid/adminapi/jboss/TestConnectorBindings.java	2010-12-13 22:02:28 UTC (rev 2774)
@@ -28,6 +28,7 @@
 import org.teiid.adminapi.Transaction;
 import org.teiid.adminapi.Translator;
 import org.teiid.adminapi.VDB;
+import org.teiid.adminapi.VDB.ConnectionType;
 import org.teiid.core.util.UnitTestUtil;
 
 @Ignore
@@ -42,7 +43,7 @@
 		//if (!Bootstrap.getInstance().isStarted()) Bootstrap.getInstance().bootstrap();
 		ds = new ServerDatasourceConnection();
 		//admin = AdminProvider.getRemote( "jnp://localhost:1099", "javaduke", "anotherduke");	
-		admin = AdminFactory.getInstance().createAdmin("admin", "admin".toCharArray(), "mm://localhost:31443"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		admin = AdminFactory.getInstance().createAdmin("admin", "admin".toCharArray(), "mms://127.0.0.1:31443"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
 		installVDB();
 	}
@@ -81,6 +82,22 @@
 		
 		assertNull(admin.getVDB("TransactionsRevisited", 1)); //$NON-NLS-1$
 	}
+	
+	@Test
+	public void testChangeConnectionType() throws Exception {
+		VDB vdb = admin.getVDB("TransactionsRevisited", 1);
+		assertNotNull(vdb); //$NON-NLS-1$
+		
+		ConnectionType ct = vdb.getConnectionType();
+		assertEquals(ConnectionType.BY_VERSION, ct);
+		
+		admin.changeVDBConnectionType("TransactionsRevisited", 1, ConnectionType.ANY);
+		
+		vdb = admin.getVDB("TransactionsRevisited", 1);
+		
+		ct = vdb.getConnectionType();
+		assertEquals(ConnectionType.ANY, ct);		
+	}
 
 	@Test public void testGetVDB() throws Exception {
 		VDB vdb = admin.getVDB("TransactionsRevisited", 1);

Modified: trunk/test-integration/db/src/test/resources/TransactionsRevisited.vdb
===================================================================
(Binary files differ)



More information about the teiid-commits mailing list