[teiid-commits] teiid SVN: r1662 - in trunk: client/src/main/java/com/metamatrix/jdbc/api and 14 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Mon Dec 14 13:48:27 EST 2009


Author: shawkins
Date: 2009-12-14 13:48:26 -0500 (Mon, 14 Dec 2009)
New Revision: 1662

Removed:
   trunk/engine/src/test/java/com/metamatrix/query/parser/TestParseCommandType.java
Modified:
   trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/BaseDataSource.java
   trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
   trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
   trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java
   trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java
   trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
   trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDataSource.java
   trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDriver.java
   trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMStatement.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
   trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java
   trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java
   trunk/client/src/main/java/com/metamatrix/jdbc/api/ExecutionProperties.java
   trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java
   trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml
   trunk/engine/src/main/java/com/metamatrix/query/parser/QueryParser.java
   trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
   trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
   trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
   trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
   trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
Log:
TEIID-897 TEIID-906 initial changes to autowrap mode and adding the ability to use a set statement to control execution variables.

Modified: trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client/src/main/java/com/metamatrix/dqp/message/RequestMessage.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -68,9 +68,6 @@
     // Treat the double quoted strings as variables in the command
     private boolean ansiQuotedIdentifiers = true;
     
-    //whether query plan is allowed or not
-    private boolean queryPlanAllowed = true;
-    
     private boolean showPlan = false;
     
     private int rowLimit;
@@ -204,7 +201,7 @@
      */
     public String getTxnAutoWrapMode() {
     	if (txnAutoWrapMode == null) {
-    		return ExecutionProperties.AUTO_WRAP_OPTIMISTIC;
+    		return ExecutionProperties.TXN_WRAP_AUTO;
     	}
         return txnAutoWrapMode;
     }
@@ -217,10 +214,9 @@
     public void setTxnAutoWrapMode(String txnAutoWrapMode) throws MetaMatrixProcessingException {
     	if (txnAutoWrapMode != null) {
     		txnAutoWrapMode = txnAutoWrapMode.toUpperCase();
-    		if (!(txnAutoWrapMode.equals(ExecutionProperties.AUTO_WRAP_OFF)
-    			|| txnAutoWrapMode.equals(ExecutionProperties.AUTO_WRAP_ON)
-    			|| txnAutoWrapMode.equals(ExecutionProperties.AUTO_WRAP_OPTIMISTIC)
-    			|| txnAutoWrapMode.equals(ExecutionProperties.AUTO_WRAP_PESSIMISTIC))) {
+    		if (!(txnAutoWrapMode.equals(ExecutionProperties.TXN_WRAP_OFF)
+    			|| txnAutoWrapMode.equals(ExecutionProperties.TXN_WRAP_ON)
+    			|| txnAutoWrapMode.equals(ExecutionProperties.TXN_WRAP_AUTO))) {
     			throw new MetaMatrixProcessingException(CommonCommPlugin.Util.getString("RequestMessage.invalid_txnAutoWrap", txnAutoWrapMode)); //$NON-NLS-1$
     		}
     	} 
@@ -315,14 +311,6 @@
 		this.ansiQuotedIdentifiers = ansiQuotedIdentifiers;
 	}
 
-    public void setQueryPlanAllowed(boolean allowed) {
-    	queryPlanAllowed = allowed;
-    }
-
-    public boolean isQueryPlanAllowed() {
-        return queryPlanAllowed;
-    }
-    
     /** 
      * @return Returns the showPlan.
      * @since 4.3

Modified: trunk/client/src/main/java/com/metamatrix/jdbc/api/ExecutionProperties.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/jdbc/api/ExecutionProperties.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client/src/main/java/com/metamatrix/jdbc/api/ExecutionProperties.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -30,8 +30,6 @@
  */
 public interface ExecutionProperties {
 
-    
-    
     /** Execution property name for XML format */
     public static final String PROP_XML_FORMAT = "XMLFormat"; //$NON-NLS-1$
     
@@ -39,7 +37,7 @@
     public static final String PROP_XML_VALIDATION = "XMLValidation"; //$NON-NLS-1$
 
     /** Execution property name for transaction auto wrap mode */
-    public static final String PROP_TXN_AUTO_WRAP = "txnAutoWrap"; //$NON-NLS-1$
+    public static final String PROP_TXN_AUTO_WRAP = "autoCommitTxn"; //$NON-NLS-1$
 
     /** Execution property name for partial results mode */
     public static final String PROP_PARTIAL_RESULTS_MODE = "partialResultsMode"; //$NON-NLS-1$
@@ -52,22 +50,18 @@
 
     /** Transaction auto wrap constant - never wrap a command execution in a transaction
      *  and allow multi-source updates to occur outside of a transaction. */
-    public static final String AUTO_WRAP_OFF = "OFF"; //$NON-NLS-1$
+    public static final String TXN_WRAP_OFF = "OFF"; //$NON-NLS-1$
 
     /** Transaction auto wrap constant - always wrap every non-transactional command
      *  execution in a transaction. */
-    public static final String AUTO_WRAP_ON = "ON"; //$NON-NLS-1$
+    public static final String TXN_WRAP_ON = "ON"; //$NON-NLS-1$
 
-    /** Transaction auto wrap constant - pessimistic mode assumes that any command
-     *  execution might require a transaction to be wrapped around it.  To determine
-     *  this an extra server call is made to check whether the command requires
-     *  a transaction and a transaction will be automatically started.  This is most
-     *  accurate and safe, but has a performance impact. */
-    public static final String AUTO_WRAP_PESSIMISTIC = "PESSIMISTIC"; //$NON-NLS-1$
+    /**
+     * Transaction auto wrap constant - checks if a command
+     * requires a transaction and will be automatically wrap it.
+     */
+    public static final String TXN_WRAP_AUTO = "AUTO"; //$NON-NLS-1$
 
-    /** Transaction auto wrap constant */
-    public static final String AUTO_WRAP_OPTIMISTIC = "OPTIMISTIC"; //$NON-NLS-1$
-
     /** 
      * Whether to use result set cache if it is available 
      * @since 4.2 
@@ -104,6 +98,5 @@
      */
     public static final String SQL_OPTION_SHOWPLAN = "SHOWPLAN"; //$NON-NLS-1$
     
-    public static final String PLAN_NOT_ALLOWED = "planNotAllowed"; //$NON-NLS-1$
 }
     
\ No newline at end of file

Modified: trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java
===================================================================
--- trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client/src/test/java/com/metamatrix/dqp/message/TestRequestMessage.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -60,7 +60,7 @@
         message.setStyleSheet("myStyleSheet"); //$NON-NLS-1$
         message.setExecutionPayload("myExecutionPayload"); //$NON-NLS-1$
         try {
-			message.setTxnAutoWrapMode(ExecutionProperties.AUTO_WRAP_ON);
+			message.setTxnAutoWrapMode(ExecutionProperties.TXN_WRAP_ON);
 		} catch (MetaMatrixProcessingException e) {
 			throw new RuntimeException(e);
 		} 
@@ -89,7 +89,7 @@
         assertEquals(new Date(12345678L), copy.getProcessingTimestamp());
         assertEquals("myStyleSheet", copy.getStyleSheet()); //$NON-NLS-1$
         assertEquals("myExecutionPayload", copy.getExecutionPayload()); //$NON-NLS-1$
-        assertEquals(ExecutionProperties.AUTO_WRAP_ON, copy.getTxnAutoWrapMode()); //$NON-NLS-1$
+        assertEquals(ExecutionProperties.TXN_WRAP_ON, copy.getTxnAutoWrapMode()); //$NON-NLS-1$
         assertTrue(copy.getValidationMode());
         assertEquals("xMLFormat", copy.getXMLFormat()); //$NON-NLS-1$
         assertTrue(copy.getShowPlan());

Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/BaseDataSource.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/BaseDataSource.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/BaseDataSource.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -201,38 +201,6 @@
     
     private String disableLocalTxn;
 
-    /**
-     * A setting that controls how connections created by this DataSource manage transactions for client
-     * requests when client applications do not use transactions.  Because a Teiid virtual database
-     * will likely deal with multiple underlying information sources, Teiid will execute
-     * all client requests within the contexts of transactions.  This method determines the semantics
-     * of creating such transactions when the client does not explicitly do so.
-     * <p>
-     * The allowable values for this property are:
-     * <ul>
-     *   <li>"<code>OFF</code>" - Nothing is ever wrapped in a transaction and the server will execute
-     * multi-source updates happily but outside a transaction.  This is least safe but highest performance.
-     * The {@link #TXN_AUTO_WRAP_OFF} constant value is provided for convenience.</li>
-     *   <li>"<code>ON</code>" - Always wrap every command in a transaction.  This is most safe but lowest
-     * performance.
-     * The {@link #TXN_AUTO_WRAP_ON} constant value is provided for convenience.</li>
-     *   <li>"<code>PESSIMISTIC</code>" - Assume that any command might require a transaction.  Make a server
-     * call to check whether the command being executed needs a transaction and wrap the command in a
-     * transaction if necessary.  This will auto wrap in exactly the cases where it is needed but requires
-     * an extra server call on every command execution (including queries).  This is as safe as ON, but
-     * lower performance than OFF for cases where no transaction is actually needed (like queries).
-     * This is the default value.
-     * The {@link #TXN_AUTO_WRAP_PESSIMISTIC} constant value is provided for convenience.</li>
-     *   <li>"<code>OPTIMISTIC</code>" - same as OFF but assume that no command not in a transaction actually
-     * needs one.  In other words, we're letting the user decide when to use and not use a transaction and
-     * assuming they are doing it correctly.  Only difference from OFF is that if the user executes a command
-     * that requires a transaction but they don't use one, we will detect this and throw an exception.  This
-     * provides the safety of ON or PESSIMISTIC mode but better performance in the common case of queries
-     * that are not multi-source.
-     * The {@link #TXN_AUTO_WRAP_OPTIMISTIC} constant value is provided for convenience.</li>
-     * </ul>
-     * </p>
-     */
     private String transactionAutoWrap;
     
     private boolean ansiQuotedIdentifiers = true;
@@ -252,35 +220,21 @@
      * Transaction auto wrap constant - never wrap a command execution in a transaction
      * and allow multi-source updates to occur outside of a transaction.
      */
-    public static final String TXN_AUTO_WRAP_OFF = "OFF"; //$NON-NLS-1$
+    public static final String TXN_WRAP_OFF = ExecutionProperties.TXN_WRAP_OFF;
 
     /**
      * Transaction auto wrap constant - always wrap every non-transactional command
      * execution in a transaction.
      */
-    public static final String TXN_AUTO_WRAP_ON = "ON"; //$NON-NLS-1$
+    public static final String TXN_WRAP_ON = ExecutionProperties.TXN_WRAP_ON;
 
     /**
-     * Transaction auto wrap constant - pessimistic mode assumes that any command
-     * execution might require a transaction to be wrapped around it.  To determine
-     * this an extra server call is made to check whether the command requires
-     * a transaction and a transaction will be automatically started.  This is most
-     * accurate and safe, but has a performance impact.
+     * Transaction auto wrap constant - checks if a command
+     * requires a transaction and will be automatically wrap it.
      */
-    public static final String TXN_AUTO_WRAP_PESSIMISTIC = "PESSIMISTIC"; //$NON-NLS-1$
+    public static final String TXN_WRAP_AUTO = ExecutionProperties.TXN_WRAP_AUTO;
 
     /**
-     * Transaction auto wrap constant - optimistic mode assumes that non-transactional
-     * commands typically do not require a transaction due to a multi-source update,
-     * so no transaction is created.  In this respect, this mode is identical to
-     * {@link #TXN_AUTO_WRAP_OFF}.  However, these modes differ because if we
-     * discover during server execution that multiple sources will be updated by
-     * a particular command, an exception is thrown to indicate that the command
-     * cannot be executed.  This is the default mode.
-     */
-    public static final String TXN_AUTO_WRAP_OPTIMISTIC = "OPTIMISTIC"; //$NON-NLS-1$
-
-    /**
      * String to hold additional properties that are not represented with an explicit getter/setter
      */
     private String additionalProperties;
@@ -733,7 +687,8 @@
     }
 
     /**
-     * @see #getTxnAutoWrap()
+     * @deprecated
+     * @see #getAutoCommitTxn()
      * @return
      */
     public String getTransactionAutoWrap() {
@@ -741,7 +696,8 @@
     }
 
     /**
-     * @see #setTxnAutoWrap(String)
+     * @deprecated
+     * @see #setAutoCommitTxn(String)
      * @param transactionAutoWrap
      */
     public void setTransactionAutoWrap(String transactionAutoWrap) {
@@ -758,13 +714,13 @@
      * @return the current setting, or null if the property has not been set and the default mode will
      * be used.
      */
-    public String getTxnAutoWrap() {
+    public String getAutoCommitTxn() {
 		return this.transactionAutoWrap;
 	}
     
     /**
      * Sets the setting for how connections are created by this DataSource manage transactions
-     * for client requests when client applications do not use transactions.
+     * for client requests with autoCommit = true.
      * Because a virtual database will likely deal with multiple underlying information sources,
      * Teiid will execute all client requests within the contexts of transactions.
      * This method determines the semantics of creating such transactions when the client does not
@@ -774,28 +730,18 @@
      * <ul>
      *   <li>"<code>OFF</code>" - Nothing is ever wrapped in a transaction and the server will execute
      * multi-source updates happily but outside a transaction.  This is least safe but highest performance.
-     * The {@link #TXN_AUTO_WRAP_OFF} constant value is provided for convenience.</li>
+     * The {@link #TXN_WRAP_OFF} constant value is provided for convenience.</li>
      *   <li>"<code>ON</code>" - Always wrap every command in a transaction.  This is most safe but lowest
      * performance.
-     * The {@link #TXN_AUTO_WRAP_ON} constant value is provided for convenience.</li>
-     *   <li>"<code>PESSIMISTIC</code>" - Assume that any command might require a transaction.  Make a server
-     * call to check whether the command being executed needs a transaction and wrap the command in a
-     * transaction if necessary.  This will auto wrap in exactly the cases where it is needed but requires
-     * an extra server call on every command execution (including queries).  This is as safe as ON, but
-     * lower performance than OFF for cases where no transaction is actually needed (like queries).
-     * The {@link #TXN_AUTO_WRAP_PESSIMISTIC} constant value is provided for convenience.</li>
-     *   <li>"<code>OPTIMISTIC</code>" - same as OFF but assume that no command not in a transaction actually
-     * needs one.  In other words, we're letting the user decide when to use and not use a transaction and
-     * assuming they are doing it correctly.  Only difference from OFF is that if the user executes a command
-     * that requires a transaction but they don't use one, we will detect this and throw an exception.  This
-     * provides the safety of ON or PESSIMISTIC mode but better performance in the common case of queries
-     * that are not multi-source.
-     * The {@link #TXN_AUTO_WRAP_OPTIMISTIC} constant value is provided for convenience.</li>
+     * The {@link #TXN_WRAP_ON} constant value is provided for convenience.</li>
+     *   <li>"<code>AUTO</code>" - checks if a command requires a transaction and will be automatically wrap it.
+     * This is the default mode.
+     * The {@link #TXN_WRAP_AUTO} constant value is provided for convenience.</li>
      * </ul>
      * </p>
      * @param transactionAutoWrap The transactionAutoWrap to set
      */
-    public void setTxnAutoWrap(String transactionAutoWrap) {
+    public void setAutoCommitTxn(String transactionAutoWrap) {
     	this.transactionAutoWrap = transactionAutoWrap;
     }
 
@@ -865,21 +811,18 @@
             return null;    // no longer require an app server name, 'cause will look on classpath
         }
         final String trimmedAutoWrap = autoWrap.trim();
-        if( TXN_AUTO_WRAP_ON.equals(trimmedAutoWrap) ) {
+        if( TXN_WRAP_ON.equals(trimmedAutoWrap) ) {
             return null;
         }
-        if( TXN_AUTO_WRAP_OFF.equals(trimmedAutoWrap) ) {
+        if( TXN_WRAP_OFF.equals(trimmedAutoWrap) ) {
             return null;
         }
-        if( TXN_AUTO_WRAP_OPTIMISTIC.equals(trimmedAutoWrap) ) {
+        if( TXN_WRAP_AUTO.equals(trimmedAutoWrap) ) {
             return null;
         }
-        if( TXN_AUTO_WRAP_PESSIMISTIC.equals(trimmedAutoWrap) ) {
-            return null;
-        }
 
         Object[] params = new Object[] {
-            TXN_AUTO_WRAP_ON, TXN_AUTO_WRAP_OFF, TXN_AUTO_WRAP_OPTIMISTIC, TXN_AUTO_WRAP_PESSIMISTIC };
+            TXN_WRAP_ON, TXN_WRAP_OFF, TXN_WRAP_AUTO };
         return JDBCPlugin.Util.getString("MMDataSource.Invalid_trans_auto_wrap_mode", params); //$NON-NLS-1$
     }
          

Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -74,7 +74,7 @@
     /**
      * Returns true if the driver thinks that it can open a connection to the given URL. Typically drivers will return true if
      * they understand the subprotocol specified in the URL and false if they don't. Expected URL format is
-     * jdbc:metamatrix:VDB at pathToPropertyFile;version=1;logFile=<logFile.log>;logLevel=<logLevel>;txnAutoWrap=<?>
+     * jdbc:metamatrix:VDB at pathToPropertyFile;version=1;logFile=<logFile.log>;logLevel=<logLevel>;property=<?>
      * 
      * @param The URL used to establish a connection.
      * @return A boolean value indicating whether the driver understands the subprotocol.

Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMConnection.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -134,7 +134,7 @@
         // set default properties if not overridden
         String overrideProp = info.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP);
         if ( overrideProp == null || overrideProp.trim().length() == 0 ) {
-            info.put(ExecutionProperties.PROP_TXN_AUTO_WRAP, ExecutionProperties.AUTO_WRAP_OPTIMISTIC);
+            info.put(ExecutionProperties.PROP_TXN_AUTO_WRAP, ExecutionProperties.TXN_WRAP_AUTO);
         }
 
         // Get default fetch size
@@ -177,6 +177,10 @@
         this.disableLocalTransactions = Boolean.valueOf(this.propInfo.getProperty(ExecutionProperties.DISABLE_LOCAL_TRANSACTIONS)).booleanValue();
     }
     
+    protected Properties getConnectionProperties() {
+        return this.propInfo;
+    }
+    
     ClientSideDQP getDQP() {
     	return this.dqp;
     }

Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDriver.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -152,7 +152,7 @@
      * These include required and any optional properties specified in the URL.
      * Expected URL format -- jdbc:metamatrix:local:VDB at server:port;version=1;user=logon;
      * password=pw;logFile=<logFile.log>;
-     * logLevel=<logLevel>;txnAutoWrap=<?>;credentials=mycredentials
+     * logLevel=<logLevel>;credentials=mycredentials
      * @param The URL needed to be parsed.
      * @param The properties object which is to be updated with properties in the URL.
      * @throws SQLException if the URL is not in the expected format.
@@ -195,7 +195,7 @@
      * Typically drivers will return true if they understand the subprotocol specified
      * in the URL and false if they don't.
      * Expected URL format is
-     * jdbc:metamatrix:subprotocol:VDB at server:port;version=1;logFile=<logFile.log>;logLevel=<logLevel>;txnAutoWrap=<?>
+     * jdbc:metamatrix:subprotocol:VDB at server:port;version=1;logFile=<logFile.log>;logLevel=<logLevel>;
      * @param The URL used to establish a connection.
      * @return A boolean value indicating whether the driver understands the subprotocol.
      * @throws SQLException, should never occur

Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMStatement.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -45,12 +45,13 @@
 import java.util.concurrent.TimeoutException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
 import com.metamatrix.api.exception.MetaMatrixException;
 import com.metamatrix.api.exception.MetaMatrixProcessingException;
 import com.metamatrix.common.comm.exception.CommunicationException;
-import com.metamatrix.common.util.PropertiesUtils;
 import com.metamatrix.common.util.SqlUtil;
 import com.metamatrix.dqp.client.ClientSideDQP;
 import com.metamatrix.dqp.message.ParameterInfo;
@@ -154,6 +155,8 @@
     //Map<out/inout/return param index --> index in results>
     protected Map outParamIndexMap = new HashMap();
     
+    private Pattern setStatement = Pattern.compile("\\s*set\\s*(\\w+)\\s*=\\s*(\\w*)", Pattern.CASE_INSENSITIVE); //$NON-NLS-1$
+    
     /**
      * Factory Constructor 
      * @param driverConnection
@@ -174,7 +177,7 @@
         this.driverConnection = driverConnection;
         this.resultSetType = resultSetType;
         this.resultSetConcurrency = resultSetConcurrency;
-        this.execProps = PropertiesUtils.clone(getConnectionProperties());
+        this.execProps = new Properties(this.driverConnection.getConnectionProperties());
         
         // Set initial fetch size
         String fetchSizeStr = this.execProps.getProperty(ExecutionProperties.PROP_FETCH_SIZE);
@@ -403,8 +406,20 @@
         throws SQLException, MMSQLException {
         checkStatement();
         resetExecutionState();
-        RequestMessage reqMessage = createRequestMessage(commands,
-				isBatchedCommand, requiresResultSet);
+        
+        //handle set statement
+        if (commands.length == 1 && requiresResultSet != Boolean.TRUE) {
+        	Matcher match = setStatement.matcher(commands[0]);
+        	if (match.matches()) {
+        		String key = match.group(1);
+        		String value = match.group(2);
+        		this.driverConnection.getConnectionProperties().setProperty(key, value);
+        		this.updateCounts = new int[] {1};
+        		return;
+        	}
+        }
+        
+        RequestMessage reqMessage = createRequestMessage(commands, isBatchedCommand, requiresResultSet);
     	ResultsMessage resultsMsg = null;
         try {
         	resultsMsg = sendRequestMessageAndWait(reqMessage);
@@ -704,17 +719,12 @@
         }
     }
 
-    protected Properties getConnectionProperties() {
-        return driverConnection.propInfo;
-    }
-
     /**
      * Helper method for copy the connection properties to request message.
      * @param res Request message that these properties to be copied to.
-     * @param props Connection properties.
      * @throws MMSQLException 
      */
-    protected void copyPropertiesToRequest(RequestMessage res, Properties props) throws MMSQLException {
+    protected void copyPropertiesToRequest(RequestMessage res) throws MMSQLException {
         // Get partial mode
         String partial = getExecutionProperty(ExecutionProperties.PROP_PARTIAL_RESULTS_MODE);
         res.setPartialResults(Boolean.valueOf(partial).booleanValue());
@@ -748,8 +758,6 @@
         // Get result set cache mode
         String rsCache = getExecutionProperty(ExecutionProperties.RESULT_SET_CACHE_MODE);
         res.setUseResultSetCache(Boolean.valueOf(rsCache).booleanValue());
-        
-        res.setQueryPlanAllowed(!Boolean.valueOf(getExecutionProperty(ExecutionProperties.PLAN_NOT_ALLOWED)).booleanValue());
     }
 
     /**
@@ -844,7 +852,7 @@
         reqMsg.setRowLimit(this.maxRows);
 
         // Get connection properties and set them onto request message
-        copyPropertiesToRequest(reqMsg, getConnectionProperties());
+        copyPropertiesToRequest(reqMsg);
 
         reqMsg.setExecutionId(this.currentRequestID);
     	

Modified: trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java
===================================================================
--- trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/main/java/org/teiid/jdbc/EmbeddedProfile.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -178,7 +178,7 @@
      * This method parses the URL and adds properties to the the properties object. These include required and any optional
      * properties specified in the URL. 
      * Expected URL format -- 
-     * jdbc:metamatrix:local:VDB@<pathToConfigFile>logFile=<logFile.log>; logLevel=<logLevel>;txnAutoWrap=<?>;credentials=mycredentials;
+     * jdbc:metamatrix:local:VDB@<pathToConfigFile>logFile=<logFile.log>; logLevel=<logLevel>;credentials=mycredentials;
      * 
      * @param The URL needed to be parsed.
      * @param The properties object which is to be updated with properties in the URL.

Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDataSource.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDataSource.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDataSource.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -46,7 +46,7 @@
     protected static final int    STD_PORT_NUMBER           = 7001;
     protected static final String STD_LOG_FILE              = UnitTestUtil.getTestScratchPath() + "/unitTestLogFile"; //$NON-NLS-1$
     protected static final int    STD_LOG_LEVEL             = 2;
-    protected static final String STD_TXN_AUTO_WRAP         = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+    protected static final String STD_TXN_WRAP         = MMDataSource.TXN_WRAP_AUTO;
     protected static final String STD_PARTIAL_MODE         = "false"; //$NON-NLS-1$
     protected static final String STD_CONFIG_FILE          = UnitTestUtil.getTestDataPath() + "/bqt/bqt.properties";  //$NON-NLS-1$
     protected static final String STD_ALTERNATE_SERVERS     = "unitTestServerName2:7001,unitTestServerName2:7002,unitTestServerName3:7001"; //$NON-NLS-1$
@@ -70,7 +70,7 @@
         dataSource.setDatabaseName(STD_DATABASE_NAME);
         dataSource.setPortNumber(STD_PORT_NUMBER);
         dataSource.setDataSourceName(STD_DATA_SOURCE_NAME);
-        dataSource.setTransactionAutoWrap(STD_TXN_AUTO_WRAP);
+        dataSource.setTransactionAutoWrap(STD_TXN_WRAP);
         dataSource.setPartialResultsMode(STD_PARTIAL_MODE);
         dataSource.setSecure(true);
         dataSource.setAlternateServers(STD_ALTERNATE_SERVERS);
@@ -280,7 +280,7 @@
 
     public void testGetTransactionAutoWrap() {
         final String result = dataSource.getTransactionAutoWrap();
-        assertEquals(result,STD_TXN_AUTO_WRAP);
+        assertEquals(result,STD_TXN_WRAP);
     }
     
     public void testGetShowPlan() {
@@ -393,17 +393,14 @@
 
 
     public void testReasonWhyInvalidTransactionAutoWrap1() {
-        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_AUTO_WRAP_OFF, VALID); //$NON-NLS-1$
+        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_WRAP_OFF, VALID); //$NON-NLS-1$
     }
     public void testReasonWhyInvalidTransactionAutoWrap2() {
-        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_AUTO_WRAP_ON, VALID); //$NON-NLS-1$
+        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_WRAP_ON, VALID); //$NON-NLS-1$
     }
     public void testReasonWhyInvalidTransactionAutoWrap3() {
-        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_AUTO_WRAP_OPTIMISTIC, VALID); //$NON-NLS-1$
+        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_WRAP_AUTO, VALID); //$NON-NLS-1$
     }
-    public void testReasonWhyInvalidTransactionAutoWrap4() {
-        helpTestReasonWhyInvalid("TransactionAutoWrap", MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC, VALID); //$NON-NLS-1$
-    }
     public void testReasonWhyInvalidTransactionAutoWrap5() {
         helpTestReasonWhyInvalid("TransactionAutoWrap", "off", INVALID);    // lowercase value //$NON-NLS-1$ //$NON-NLS-2$
     }
@@ -523,11 +520,11 @@
         final String vdbName = "vdbName"; //$NON-NLS-1$
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = false;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,null,transactionAutoWrap, partialMode, -1, false, secure, 
-                            "jdbc:teiid:vdbName at mm://hostname:7001;ApplicationName=JDBC;serverURL=mm://hostname:7001;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mm://hostname:7001;ApplicationName=JDBC;serverURL=mm://hostname:7001;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName"); //$NON-NLS-1$ 
     }
     
     public void testBuildURL3() {
@@ -535,11 +532,11 @@
         final String vdbName = "vdbName"; //$NON-NLS-1$
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = false;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,null,transactionAutoWrap, partialMode, -1, true, secure,
-                            "jdbc:teiid:vdbName at mm://hostname:7001;ApplicationName=JDBC;serverURL=mm://hostname:7001;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mm://hostname:7001;ApplicationName=JDBC;serverURL=mm://hostname:7001;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
     }
 
     // Test secure protocol
@@ -548,11 +545,11 @@
         final String vdbName = "vdbName"; //$NON-NLS-1$
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = true;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,null,transactionAutoWrap, partialMode, -1, true, secure,
-                            "jdbc:teiid:vdbName at mms://hostname:7001;ApplicationName=JDBC;serverURL=mms://hostname:7001;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mms://hostname:7001;ApplicationName=JDBC;serverURL=mms://hostname:7001;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
     }
 
     /*
@@ -566,11 +563,11 @@
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
         final String alternateServers = "hostName:7002,hostName2:7001,hostName2:7002"; //$NON-NLS-1$
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = false;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,alternateServers,transactionAutoWrap, partialMode, -1, true, secure,
-                            "jdbc:teiid:vdbName at mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
     }
 
     /*
@@ -584,11 +581,11 @@
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
         final String alternateServers = "hostName:7002,hostName2:7001,hostName2:7002"; //$NON-NLS-1$
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = true;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,alternateServers,transactionAutoWrap, partialMode, -1, true, secure,
-                            "jdbc:teiid:vdbName at mms://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mms://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mms://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mms://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
     }
 
     /*
@@ -603,11 +600,11 @@
         final String vdbVersion = ""; //$NON-NLS-1$
         final int portNumber = 7001;
         final String alternateServers = "hostName:7002,hostName2,hostName2:7002"; //$NON-NLS-1$
-        final String transactionAutoWrap = MMDataSource.TXN_AUTO_WRAP_PESSIMISTIC;
+        final String transactionAutoWrap = MMDataSource.TXN_WRAP_AUTO;
         final String partialMode = "false"; //$NON-NLS-1$
         final boolean secure = false;
         helpTestBuildingURL(vdbName,vdbVersion,serverName,portNumber,alternateServers,transactionAutoWrap, partialMode, -1, true, secure,
-                            "jdbc:teiid:vdbName at mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;txnAutoWrap=PESSIMISTIC;partialResultsMode=false;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
+                            "jdbc:teiid:vdbName at mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;ApplicationName=JDBC;serverURL=mm://hostName:7001,hostName:7002,hostName2:7001,hostName2:7002;partialResultsMode=false;autoCommitTxn=AUTO;VirtualDatabaseName=vdbName;sqlOptions=SHOWPLAN"); //$NON-NLS-1$ 
     }
     
     public void testBuildURL_AdditionalProperties() {

Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDriver.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDriver.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMDriver.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -54,12 +54,12 @@
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mms://localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:@mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:jvdb at mms://localhost:1234")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mms://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://127.0.0.1:1234;logLevel=2")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mms://127.0.0.1:1234")); //$NON-NLS-1$
         assertTrue(drv.acceptsURL("jdbc:metamatrix:vdb at mm://127.0.0.1:1234,localhost.mydomain.com:63636;logLevel=2")); //$NON-NLS-1$
@@ -79,7 +79,7 @@
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:@localhost:1234;stickyConnections=false;socketsPerVM=4")); //$NON-NLS-1$
         assertTrue(!drv.acceptsURL("jdbc:metamatrix:vdb at mm://my_host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$        
     }
@@ -114,7 +114,7 @@
     
     public void testParseURL3() throws SQLException{
         Properties p = new Properties();
-        MMDriver.getInstance().parseURL("jdbc:metamatrix:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;txnAutoWrap=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
+        MMDriver.getInstance().parseURL("jdbc:metamatrix:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$

Modified: trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMStatement.java
===================================================================
--- trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMStatement.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/test/java/com/metamatrix/jdbc/TestMMStatement.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -27,6 +27,7 @@
 import java.sql.ResultSet;
 import java.util.Arrays;
 import java.util.List;
+import java.util.Properties;
 
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -59,4 +60,13 @@
 		assertTrue(Arrays.equals(new int[] {1, 2}, statement.executeBatch()));
 	}
 	
+	@Test public void testSetStatement() throws Exception {
+		MMConnection conn = Mockito.mock(MMConnection.class);
+		Properties p = new Properties();
+		Mockito.stub(conn.getConnectionProperties()).toReturn(p);
+		MMStatement statement = new MMStatement(conn, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
+		assertFalse(statement.execute("set foo = bar")); //$NON-NLS-1$
+		assertEquals("bar", p.get("foo")); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+	
 }

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestEmbeddedProfile.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -48,22 +48,22 @@
 //        // Windows Path
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:\\metamatrix\\dqp\\dqp.properties")); //$NON-NLS-1$
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:\\metamatrix\\dqp\\dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:\\metamatrix\\dqp\\dqp.properties;version=1;txnAutoWrap=ON;partialResultsMode=YES")); //$NON-NLS-1$
+        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:\\metamatrix\\dqp\\dqp.properties;version=1;autoCommitTxn=ON;partialResultsMode=YES")); //$NON-NLS-1$
         
         // Alternative windows path
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:/metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:/metamatrix/dqp/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:/metamatrix/dqp/dqp.properties;version=1;txnAutoWrap=ON;partialResultsMode=YES")); //$NON-NLS-1$
+        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at c:/metamatrix/dqp/dqp.properties;version=1;autoCommitTxn=ON;partialResultsMode=YES")); //$NON-NLS-1$
 
         // Abosolute path (Unix or windows)
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties;version=1;txnAutoWrap=ON;partialResultsMode=YES")); //$NON-NLS-1$
+        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties;version=1;autoCommitTxn=ON;partialResultsMode=YES")); //$NON-NLS-1$
 
         // relative path
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at ../../metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at ../../metamatrix/dqp/dqp.properties;version=1")); //$NON-NLS-1$
-        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at ../../metamatrix/dqp/dqp.properties;version=1;txnAutoWrap=ON;partialResultsMode=YES")); //$NON-NLS-1$
+        assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at ../../metamatrix/dqp/dqp.properties;version=1;autoCommitTxn=ON;partialResultsMode=YES")); //$NON-NLS-1$
         
         // File URL should be supported (not sure)
         assertTrue(org.teiid.jdbc.EmbeddedProfile.acceptsURL("jdbc:metamatrix:BQT at file:///c:/metamatrix/dqp/dqp.properties")); //$NON-NLS-1$
@@ -103,7 +103,7 @@
     
     @Test public void testParseURL3() throws SQLException{
         Properties p = new Properties();
-        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties;version=4;txnAutoWrap=ON;partialResultsMode=YES;", p); //$NON-NLS-1$
+        org.teiid.jdbc.EmbeddedProfile.parseURL("jdbc:metamatrix:BQT@/metamatrix/dqp/dqp.properties;version=4;autoCommitTxn=ON;partialResultsMode=YES;", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VERSION).equals("4")); //$NON-NLS-1$

Modified: trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java
===================================================================
--- trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/client-jdbc/src/test/java/org/teiid/jdbc/TestSocketProfile.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -48,12 +48,12 @@
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:jvdb at mms://localhost:1234")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234;version=x")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://localhost:1234,localhost2:12342,localhost3:12343")); //$NON-NLS-1$       
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://127.0.0.1:1234;logLevel=2")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mms://127.0.0.1:1234")); //$NON-NLS-1$
         assertTrue(SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://127.0.0.1:1234,localhost.mydomain.com:63636;logLevel=2")); //$NON-NLS-1$
@@ -76,7 +76,7 @@
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234,localhost2:12342,localhost3:12343;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=1;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log")); //$NON-NLS-1$
-        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;txnAutoWrap=OFF;paritalResultsMode=true")); //$NON-NLS-1$
+        assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;logLevel=2;logFile=D:\\metamatrix\\work\\DQP\\log\\jdbcLogFile.log;autoCommitTxn=OFF;paritalResultsMode=true")); //$NON-NLS-1$
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:@localhost:1234;stickyConnections=false;socketsPerVM=4")); //$NON-NLS-1$
         assertTrue(!SocketProfile.acceptsURL("jdbc:teiid:vdb at mm://my_host.mydomain.com:53535,127.0.0.1:1234")); //$NON-NLS-1$        
     }
@@ -110,7 +110,7 @@
     
     @Test public void testParseURL3() throws SQLException{
         Properties p = new Properties();
-        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;txnAutoWrap=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
+        SocketProfile.parseURL("jdbc:teiid:BQT at mm://slwxp157:1234,slntmm01:43401,sluxmm09:43302;version=4;autoCommitTxn=ON;partialResultsMode=YES;ApplicationName=Client", p); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_NAME).equals("BQT")); //$NON-NLS-1$
         assertTrue(p.getProperty(BaseDataSource.VDB_VERSION).equals("4"));         //$NON-NLS-1$
         assertTrue(p.getProperty(ExecutionProperties.PROP_TXN_AUTO_WRAP).equals("ON")); //$NON-NLS-1$

Modified: trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/transaction_support.xml	2009-12-14 18:48:26 UTC (rev 1662)
@@ -26,7 +26,7 @@
 					<entry>
 						Treats the user command as if all source commands are executed
 						within the scope of the same transaction. The
-						<link linkend="autowrap">AutoWrap</link>
+						<link linkend="autowrap">AutoCommitTxn</link>
 						execution property controls the behavior of command level
 						transactions.
 					</entry>
@@ -45,13 +45,13 @@
 		</tgroup>
 	</table>
 	<sect1 id="autowrap">
-		<title>AutoWrap Execution Property</title>
+		<title>AutoCommitTxn Execution Property</title>
 		<para>Since user level commands may execute multiple source
-			commands, users can specify the AutoWrap execution property to
+			commands, users can specify the AutoCommitTxn execution property to
 			control the transactional behavior of a user command when not in a
 			local or global transaction.</para>
 		<table>
-			<title>AutoWrap Settings</title>
+			<title>AutoCommitTxn Settings</title>
 			<tgroup cols="2">
 				<colspec colwidth="1*" />
 				<colspec colwidth="3*" />
@@ -74,19 +74,9 @@
 							safest, but may be burdonsome on performance.</entry>
 					</row>
 					<row>
-						<entry>OPTIMISTIC</entry>
+						<entry>AUTO</entry>
 						<entry>
-							<emphasis>This is the default setting.</emphasis>
-							Will not automatically wrap a command in a transaction, instead
-							throw an exception if the command executed is
-							<link linkend="updating_model_count">transactionally unsafe.</link>
-							to execute outside of a transaction.
-						</entry>
-					</row>
-					<row>
-						<entry>PESSIMISTIC</entry>
-						<entry>
-							Will automatically wrap commands in a transaction, but only if
+						    This is the default setting. Will automatically wrap commands in a transaction, but only if
 							the command seems to be
 							<link linkend="updating_model_count">transactionally unsafe.</link>
 						</entry>

Modified: trunk/engine/src/main/java/com/metamatrix/query/parser/QueryParser.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/parser/QueryParser.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/main/java/com/metamatrix/query/parser/QueryParser.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -32,9 +32,6 @@
 import com.metamatrix.query.sql.lang.Criteria;
 import com.metamatrix.query.sql.lang.Option;
 import com.metamatrix.query.sql.lang.XQuery;
-import com.metamatrix.query.sql.proc.Block;
-import com.metamatrix.query.sql.proc.CriteriaSelector;
-import com.metamatrix.query.sql.proc.Statement;
 import com.metamatrix.query.sql.symbol.Expression;
 import com.metamatrix.query.xquery.XQueryExpression;
 import com.metamatrix.query.xquery.saxon.SaxonXQueryExpression;
@@ -44,9 +41,6 @@
  * QueryParser can be reused but is NOT thread-safe as the parser uses an
  * input stream.  Putting multiple queries into the same stream will result
  * in unpredictable and most likely incorrect behavior.</p>
- *
- * <p>In the future this class may hide a single- or multi-thread cache
- * of parsed queries. </p>
  */
 public class QueryParser {
     
@@ -66,7 +60,7 @@
     
     private static final String XQUERY_DECLARE = "declare"; //$NON-NLS-1$
     private static final String XML_OPEN_BRACKET = "<"; //$NON-NLS-1$
-    private static final String BOGUS_SELECT = "select x "; //$NON-NLS-1$
+    private static final String XML_CLOSE_BRACKET = ">"; //$NON-NLS-1$
 
 	private SQLParser parser;
     
@@ -119,37 +113,39 @@
             throw new QueryParserException(QueryPlugin.Util.getString("QueryParser.emptysql")); //$NON-NLS-1$
         }
         
-        // For XQueries
-        int type = getCommandType(sql);
-        if (type == Command.TYPE_XQUERY || type == Command.TYPE_UNKNOWN){
+        QueryParserException qpe = null;
+        try {
+	        Command result = parseCommandWithParser(sql, parseInfo);
+			return result;
+        } catch (QueryParserException e) {
+        	qpe = e;
+        }
+        
+        try {
+            // Check for OPTION
+            Option option = null;
+            int closeBracket = sql.lastIndexOf(XML_CLOSE_BRACKET);
+            int optionIndex = sql.toUpperCase().lastIndexOf(ReservedWords.OPTION);
+            if (optionIndex != -1 && optionIndex > closeBracket){
+                String optionSQL = sql.substring(optionIndex);
+                option = getOption(optionSQL, parseInfo);
+                sql = sql.substring(0, optionIndex-1);
+            }
             
-            try {
-                
-                // Check for OPTION
-                Option option = null;
-                int optionIndex = sql.toUpperCase().lastIndexOf(ReservedWords.OPTION);
-                if (optionIndex != -1){
-                    String optionSQL = sql.substring(optionIndex);
-                    option = getOption(optionSQL);
-                    sql = sql.substring(0, optionIndex-1);
-                }
-                
-                XQueryExpression expr = new SaxonXQueryExpression();
-                expr.compileXQuery(sql);
-                XQuery xquery = new XQuery(sql, expr);
-                if (option != null){
-                    xquery.setOption(option);
-                }
-                return xquery;        
-            } catch (MetaMatrixProcessingException e) {
-                if (type == Command.TYPE_XQUERY){
-                    throw new QueryParserException(QueryPlugin.Util.getString("QueryParser.xqueryCompilation", e.getMessage())); //$NON-NLS-1$
-                } // else let unknown query type fall through to code below for better error handling
+            XQueryExpression expr = new SaxonXQueryExpression();
+            expr.compileXQuery(sql);
+            XQuery xquery = new XQuery(sql, expr);
+            if (option != null){
+                xquery.setOption(option);
             }
+            return xquery;        
+        } catch (MetaMatrixProcessingException e) {
+            if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) {
+            	throw new QueryParserException(e, QueryPlugin.Util.getString("QueryParser.xqueryCompilation")); //$NON-NLS-1$
+            }
         }
 
-        Command result = parseCommandWithParser(sql, parseInfo);
-		return result;
+        throw qpe;
 	}
 
     /**
@@ -157,10 +153,18 @@
      * @param optionSQL option SQL
      * @return Option object
      */
-    private Option getOption(String optionSQL) throws QueryParserException {
-        String sql = BOGUS_SELECT + optionSQL;
-        Command command = parseCommandWithParser(sql, new ParseInfo());
-        return command.getOption();
+    private Option getOption(String optionSQL, ParseInfo parseInfo) throws QueryParserException {
+    	Option result = null;
+        try{
+            result = getSqlParser(optionSQL).option(parseInfo);
+            
+        } catch(ParseException pe) {
+            throw convertParserException(pe);
+
+        } catch(TokenMgrError tme) {
+            handleTokenMgrError(tme);
+        }
+        return result;
     }
 
     /**
@@ -184,35 +188,6 @@
     }
 
     /**
-     * Takes a SQL string representing an SQL statement
-     * and returns the procedure object representation.
-     * @param stmt SQL statement string
-     * @return Statement Procedure object representation
-     * @throws QueryParserException if parsing fails
-     * @throws IllegalArgumentException if stmt is null
-     */
-     Statement parseStatement(String stmt) throws QueryParserException {
-        if(stmt == null) {
-            throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$
-        }
-
-        ParseInfo dummyInfo = new ParseInfo();
-
-        Statement result = null;
-        try{
-            result = getSqlParser(stmt).statement(dummyInfo);
-
-        } catch(ParseException pe) {
-            throw convertParserException(pe);
-
-        } catch(TokenMgrError tme) {
-            handleTokenMgrError(tme);
-        }
-        return result;
-    }
-
-
-    /**
      * Takes a SQL string representing an SQL criteria (i.e. just the WHERE
      * clause) and returns the object representation.
      * @param sql SQL criteria (WHERE clause) string
@@ -240,65 +215,11 @@
         return result;
     }
 
-    /**
-     * Takes a SQL string representing a block
-     * and returns the object representation.
-     * @param block Block string
-     * @return Block Block object representation
-     * @throws QueryParserException if parsing fails
-     * @throws IllegalArgumentException if sql is null
-     */
-     Block parseBlock(String block) throws QueryParserException {
-        if(block == null) {
-            throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullBlock")); //$NON-NLS-1$
-        }
-
-        ParseInfo dummyInfo = new ParseInfo();
-
-        Block result = null;
-        try{
-            result = getSqlParser(block).block(dummyInfo);
-
-        } catch(ParseException pe) {
-            throw convertParserException(pe);
-
-        } catch(TokenMgrError tme) {
-            handleTokenMgrError(tme);
-        }
-        return result;
-    }
-     
     private QueryParserException convertParserException(ParseException pe) {
         return new QueryParserException(QueryPlugin.Util.getString("QueryParser.parsingError", pe.getMessage())); //$NON-NLS-1$                        
     }
 
     /**
-     * Takes a SQL string representing a criteria selector
-     * and returns the object representation.
-     * @param selector criteria selector string
-     * @return CriteriaSelector CriteriaSelector object representation
-     * @throws QueryParserException if parsing fails
-     * @throws IllegalArgumentException if sql is null
-     */
-    CriteriaSelector parseCriteriaSelector(String selector) throws QueryParserException {
-        if(selector == null) {
-            throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$
-        }
-
-        CriteriaSelector result = null;
-        try{
-            result = getSqlParser(selector).criteriaSelector();
-
-        } catch(ParseException pe) {
-            throw convertParserException(pe);
-
-        } catch(TokenMgrError tme) {
-            handleTokenMgrError(tme);
-        }
-        return result;
-    }
-
-    /**
      * Takes a SQL string representing an SQL expression
      * and returns the object representation.
      * @param sql SQL expression string
@@ -363,54 +284,4 @@
         throw new QueryParserException(QueryPlugin.Util.getString("QueryParser.parsingError", tme.getMessage())); //$NON-NLS-1$
     }
 
-	/**
-	 * Takes a SQL string and determines the command type, as defined in the constants
-	 * of {@link com.metamatrix.query.sql.lang.Command}.
-	 * @param sql SQL string
-	 * @return Command type code, as defined in {@link com.metamatrix.query.sql.lang.Command}.
-     * Note: not all XQuery queries will necessarily be detected - if type UNKNOWN is indicated
-     * it's possible it is an XQuery.
-	 * @throws IllegalArgumentException if sql is null
-	 */
-	public static int getCommandType(String sql) {
-		if(sql == null) {
-            throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.emptysql")); //$NON-NLS-1$
-		}
-
-        // Shortcut for most XQuery commands
-        if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) {
-            return Command.TYPE_XQUERY;
-        }
-
-		int startCommand = -1;
-		for(int index = 0; index < sql.length(); index++) {
-			char c = sql.charAt(index);
-			if(Character.isLetter(c) || c == '{') {
-			    startCommand = index;
-			    break;
-			} 
-		}
-
-		if(startCommand == -1) {
-			return Command.TYPE_UNKNOWN;
-		}
-
-		String commandWord = sql.substring(startCommand, Math.min(startCommand+6, sql.length())).toUpperCase();
-        if(commandWord.startsWith(ReservedWords.SELECT)) {
-			return Command.TYPE_QUERY;
-		} else if(commandWord.startsWith(ReservedWords.INSERT)) {
-			return Command.TYPE_INSERT;
-		} else if(commandWord.startsWith(ReservedWords.UPDATE)) {
-			return Command.TYPE_UPDATE;
-		} else if(commandWord.startsWith(ReservedWords.DELETE)) {
-			return Command.TYPE_DELETE;
-		} else if(commandWord.startsWith(ReservedWords.EXEC) || commandWord.startsWith("{")) { //$NON-NLS-1$
-			return Command.TYPE_STORED_PROCEDURE;
-        } else if(commandWord.startsWith(ReservedWords.CREATE)) { 
-            return Command.TYPE_UPDATE_PROCEDURE;
-		} else {
-			return Command.TYPE_UNKNOWN;
-		}
-	}
-
 }

Modified: trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/main/java/com/metamatrix/query/processor/proc/ExecDynamicSqlInstruction.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -310,20 +310,6 @@
 			}
 		}
 
-		// validate the updating model count if transaction is optimistic
-		// Error if orig = 0 and command > 0 OR if orig = 1 and command <> 1
-		if (procEnv.getContext().isOptimisticTransaction()) {
-			final int origModelCount = dynamicCommand.getUpdatingModelCount();
-			final int newModelCount = command.updatingModelCount(metadata);
-			if ((origModelCount == 0 || origModelCount == 1)
-					&& newModelCount > origModelCount) {
-				Object[] params = new Object[] { new Integer(newModelCount),
-						new Integer(origModelCount) };
-				throw new QueryProcessingException(QueryExecPlugin.Util
-						.getString("ExecDynamicSqlInstruction.1", params)); //$NON-NLS-1$
-			}
-		}
-
 		// do a recursion check
 		// Add group to recursion stack
 		CommandContext context = procEnv.getContext();

Modified: trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/main/java/com/metamatrix/query/util/CommandContext.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -82,8 +82,6 @@
     
     private Stack<String> recursionStack = null;
     
-    private boolean optimisticTransaction = false;
-    
     private SecurityFunctionEvaluator securityFunctionEvaluator;
     
     private Object tempTableStore;
@@ -148,7 +146,6 @@
         if (context.recursionStack != null) {
             this.recursionStack = (Stack)context.recursionStack.clone();
         }
-        setOptimisticTransaction(context.isOptimisticTransaction());
         this.setSecurityFunctionEvaluator(context.getSecurityFunctionEvaluator());
         this.planToProcessConverter = context.planToProcessConverter;
         this.queryProcessorFactory = context.queryProcessorFactory;
@@ -373,20 +370,6 @@
     }
 
     /** 
-     * @param optimisticTransaction The optimisticTransaction to set.
-     */
-    public void setOptimisticTransaction(boolean optimisticTransaction) {
-        this.optimisticTransaction = optimisticTransaction;
-    }
-
-    /** 
-     * @return Returns the optimisticTransaction.
-     */
-    public boolean isOptimisticTransaction() {
-        return optimisticTransaction;
-    }
-
-    /** 
      * @return Returns the securityFunctionEvaluator.
      */
     public SecurityFunctionEvaluator getSecurityFunctionEvaluator() {

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -359,21 +359,15 @@
             
             boolean startAutoWrapTxn = false;
             
-            if(ExecutionProperties.AUTO_WRAP_ON.equals(requestMsg.getTxnAutoWrapMode())){ 
+            if(ExecutionProperties.TXN_WRAP_ON.equals(requestMsg.getTxnAutoWrapMode())){ 
                 startAutoWrapTxn = true;
             } else if ( processingCommand.updatingModelCount(metadata) > 1) { 
-                if (ExecutionProperties.AUTO_WRAP_OPTIMISTIC.equals(requestMsg.getTxnAutoWrapMode())){ 
-                    String msg = DQPPlugin.Util.getString("Request.txn_needed_wrong_mode", requestId); //$NON-NLS-1$
-                    throw new MetaMatrixComponentException(msg);
-                } else if (ExecutionProperties.AUTO_WRAP_PESSIMISTIC.equals(requestMsg.getTxnAutoWrapMode())){
+                if (ExecutionProperties.TXN_WRAP_AUTO.equals(requestMsg.getTxnAutoWrapMode())){
                     startAutoWrapTxn = true;
-                } else if (ExecutionProperties.AUTO_WRAP_OFF.equals(requestMsg.getTxnAutoWrapMode())) {
+                } else if (ExecutionProperties.TXN_WRAP_OFF.equals(requestMsg.getTxnAutoWrapMode())) {
                     LogManager.logDetail(LogConstants.CTX_DQP, DQPPlugin.Util.getString("Request.potentially_unsafe")); //$NON-NLS-1$ 
                 }
             } 
-            if(ExecutionProperties.AUTO_WRAP_OPTIMISTIC.equals(requestMsg.getTxnAutoWrapMode())){
-                this.context.setOptimisticTransaction(true);
-            }
             
             if (startAutoWrapTxn) {
                 if (transactionService == null) {
@@ -542,7 +536,7 @@
         }
     }
 
-    private void createAnalysisRecord(Command command) throws QueryValidatorException{
+    private void createAnalysisRecord(Command command) {
         Option option = command.getOption();
         boolean getPlan = requestMsg.getShowPlan();
         boolean debug = false;
@@ -551,11 +545,6 @@
             debug = option.getDebug();
         }
         
-        if (getPlan && !requestMsg.isQueryPlanAllowed()){
-          	final String message = DQPPlugin.Util.getString("Request.query_plan_not_allowed"); //$NON-NLS-1$
-            throw new QueryValidatorException(message);
-        }       
-        
         this.analysisRecord = new AnalysisRecord(getPlan, getPlan, debug);
     }
 

Modified: trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2009-12-14 18:48:26 UTC (rev 1662)
@@ -371,9 +371,8 @@
 Request.txn.info.resume=Resumed transaction "{0}".
 Request.txn.info.export=Exported transaction "{0}".
 Request.txn.info.suspend=Suspended transaction "{0}".
-Request.txn_needed_wrong_mode=Detected request "{0}" with multiple updates when using txnAutoWrap=OPTIMISTIC.  If you are using MetaMatrix Enterprise, you can set txnAutoWrap=OFF to avoid using a transaction or txnAutoWrap=PESSIMISTIC to automatically create a transaction when needed. If you are not using MetaMatrix Enterprise, no transaction manager is provided and transactions are not supported.  In that case, you can set txnAutoWrap=OFF to allow transaction methods to be called and ignored without actual transaction support. WARNING: Setting txnAutowrap=OFF and using transaction methods is risky because transactions will not be executed atomically and rollback will not occur!
 Request.transaction_not_supported=Autowrap transaction required, but transaction support is disabled
-Request.potentially_unsafe=The request is modifying more than 1 model without any containing transaction (txnAutoWrap = OFF).  This is potentially unsafe as the updates cannot be rolled back as a single unit.
+Request.potentially_unsafe=The request is modifying more than 1 model without any containing transaction (autoCommitTxn = OFF).  This is potentially unsafe as the updates cannot be rolled back as a single unit.
 Request.no_result_set=Statement does not return a result set.
 Request.result_set=Statement returns a result set, not an update count.
 Request.wsdl_user_not_authorized=The anonymous user is not authorized for this action.
@@ -405,28 +404,9 @@
 ResultBatch.update_count_unavailable=Unable to retrieve an update count from this batch.
 ServerConnectionInfo.invalid_context=Invalid portable context string. Unable to reinstantiate a ServerConnectionInfo from the string :{0}
 ServerConnectionInfo.invalid_url=The url "{0}" is invalid and could not be parsed. The url should be of the form mm[s]://host[,host2,host3...]:port[,port2,port3...]
-ServerFacadeImpl.invalid_txnautowrap=Invalid transaction autowrap mode "{0}"
-ServerFacadeImpl.invalid_beginRow=Invalid beginRow {0}: beginRow must be >= 1
-ServerFacadeImpl.invalid_endRow=Invalid maxEndRow {0}: beginRow must be <= maxEndRow
-ServerFacadeImpl.invalid_waitTime=Invalid waitTime {0}: waitTime must be >= 0
-ServerFacadeImpl.invalid_connInfo=The server facade expects an instance of ServerConnectionInfo.
-ServerFacadeImpl.null_requestInfo=The request info must not be null.
-ServerFacadeImpl.invalid_requestInfo=The server facade expects an instance of ServerRequest.
-ServerFacadeImpl.invalid_cursorType=The cursor type must be one of {ResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVE}.
-ServerFacadeImpl.invalid_fetchSize=The fetch size must be >= 0
-ServerFacadeImpl.invalid_requestType=The request type must be one of {RequestInfo.REQUEST_TYPE_STATEMENT,RequestInfo.REQUEST_TYPE_PREPARED_STATEMENT,RequestInfo.REQUEST_TYPE_CALLABLE_STATEMENT}.
-ServerFacadeImpl.invalid_sql=The SQL command must not be null.
-ServerFacadeImpl.invalid_txnAutowrap=The transaction autowrap mode must be one of {RequestInfo.AUTOWRAP_OFF,RequestInfo.AUTOWRAP_ON,RequestInfo.AUTOWRAP_OPTIMISTIC,RequestInfo.AUTOWRAP_PESSIMISTIC}.
 ServerSessionContext.invalid_context=Invalid portable context string. Unable to reinstantiate a server session context from the string :{0}
 ServerSessionContext.null_context=The portable session context should not be null.
 ServerConnectionInfo.invalid_encoding=Invalid encoded object within the portable string. Unable to reinstantiate an object from the encoded string :{0}
-ServerFacadeImpl.timeout=Timed out while waiting for a response.
-ServerFacadeImpl.null_connInfo=The connection info must not be null.
-ServerFacadeImpl.null_URL=The server URL must not be null.
-ServerFacadeImpl.null_user=The user name must not be null.
-ServerFacadeImpl.null_pwd=The password must not be null.
-ServerFacadeImpl.null_vdb=The VDB name must not be null.
-ServerFacadeImpl.updates_not_supported=The server facade does not support metadata requests for INSERT, UPDATE, DELETE, or SELECT...INTO statements.
 ResultBatch.not_last_batch=This method can only be called on the last batch of results.
 ResultBatch.not_out_param=The parameter at index {0} must be of type RETURN, OUT, or INOUT
 CacheResults.Trying_to_cache_unexpected_results=Trying to cache unexpected results. Expected request ID "{0}"; Got request ID "{1}"

Deleted: trunk/engine/src/test/java/com/metamatrix/query/parser/TestParseCommandType.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestParseCommandType.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestParseCommandType.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -1,92 +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 com.metamatrix.query.parser;
-
-import com.metamatrix.query.sql.lang.*;
-import junit.framework.*;
-
-public class TestParseCommandType extends TestCase {
-
-	// ################################## FRAMEWORK ################################
-	
-	public TestParseCommandType(String name) { 
-		super(name);
-	}	
-	
-	// ################################## TEST HELPERS ################################
-	
-	private void helpTest(String sql, int expectedType) {
-	    int actualType = QueryParser.getCommandType(sql);		    
-	    assertEquals("Did not get expected type", expectedType, actualType); //$NON-NLS-1$
-	}
-	
-	// ################################## ACTUAL TESTS ################################
-	
-	public void testQuery1() {
-		helpTest("SELECT a FROM g", Command.TYPE_QUERY);		 //$NON-NLS-1$
-	}
-
-	public void testQuery2() {
-		helpTest("select a FROM g", Command.TYPE_QUERY);		 //$NON-NLS-1$
-	}
-
-	public void testQuery3() {
-		helpTest("select", Command.TYPE_QUERY);		 //$NON-NLS-1$
-	}
-
-	public void testSetQuery1() {
-		helpTest("SELECT a FROM g UNION SELECT b from z", Command.TYPE_QUERY);		 //$NON-NLS-1$
-	}
-
-	public void testSetQuery2() {
-		helpTest("(Select a FROM g UNION SELECT b from z) union select c from r order by s", Command.TYPE_QUERY);		 //$NON-NLS-1$
-	}
-	
-	public void testInsert() {
-		helpTest("insert g (b) values (1)", Command.TYPE_INSERT);     //$NON-NLS-1$
-	}
-
-	public void testUpdate() {
-		helpTest("update g set b=1", Command.TYPE_UPDATE);     //$NON-NLS-1$
-	}
-
-	public void testDelete() {
-		helpTest("delete from g where x=1", Command.TYPE_DELETE);     //$NON-NLS-1$
-	}
-	
-	public void testUnknown1() {
-		helpTest("", Command.TYPE_UNKNOWN);     //$NON-NLS-1$
-	}
-
-	public void testUnknown2() {
-		helpTest("abc select", Command.TYPE_UNKNOWN);     //$NON-NLS-1$
-	}
-
-	public void testUnknown3() {
-		helpTest("selec", Command.TYPE_UNKNOWN);		 //$NON-NLS-1$
-	}
-
-	public void testUnknown4() {
-		helpTest("selec ", Command.TYPE_UNKNOWN);		 //$NON-NLS-1$
-	}
-}

Modified: trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/test/java/com/metamatrix/query/parser/TestParser.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -24,6 +24,7 @@
 
 import static org.junit.Assert.*;
 
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.util.ArrayList;
@@ -139,66 +140,30 @@
         }       
     }
     
-    private void helpBlockTest(String block, String expectedString, Block expectedBlock) {
-        Block actualBlock = null;
-        String actualString = null;
-        try {
-            actualBlock = QueryParser.getQueryParser().parseBlock(block);
-            actualString = actualBlock.toString();
-                
-        } catch(Throwable e) { 
-            fail("Exception during parsing (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
+    private void helpBlockTest(String block, String expectedString, Block expectedBlock) throws ParseException {
+        Block actualBlock = new SQLParser(new StringReader(block)).block(new ParseInfo());
+        String actualString = actualBlock.toString();
         assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
         assertEquals("Block does not match: ", expectedBlock, actualBlock);              //$NON-NLS-1$
     }
     
-    private void helpCriteriaSelectorTest(String selector, String expectedString, CriteriaSelector expectedSelector) {
-        
-        CriteriaSelector actualSelector = null;
-        String actualString = null;
-        try {
-            actualSelector = QueryParser.getQueryParser().parseCriteriaSelector(selector);
-            actualString = actualSelector.toString();
-                             
-        } catch(Throwable e) { 
-            fail("Exception during parsing (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
+    private void helpCriteriaSelectorTest(String selector, String expectedString, CriteriaSelector expectedSelector) throws ParseException {
+        CriteriaSelector actualSelector = new SQLParser(new StringReader(selector)).criteriaSelector();
+        String actualString = actualSelector.toString();
         assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
         assertEquals("CriteriaSelector does not match: ", expectedSelector, actualSelector);              //$NON-NLS-1$
     }
 	
-    private void helpCriteriaTest(String crit, String expectedString, Criteria expectedCrit) {
-               
-        Criteria actualCrit = null;
-        String actualString = null;
-        try {
-            //actualCrit = QueryParser.getQueryParser().parsePredicateCriteria(crit);
-            actualCrit = QueryParser.getQueryParser().parseCriteria(crit);
-            actualString = actualCrit.toString();
-                
-        } catch(Throwable e) { 
-            fail("Exception during parsing (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
+    private void helpCriteriaTest(String crit, String expectedString, Criteria expectedCrit) throws QueryParserException {
+        Criteria actualCrit = QueryParser.getQueryParser().parseCriteria(crit);
+        String actualString = actualCrit.toString();
         assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
         assertEquals("Criteria does not match: ", expectedCrit, actualCrit);              //$NON-NLS-1$
-        
     }
     
-    private void helpStmtTest(String stmt, String expectedString, Statement expectedStmt) {
-        Statement actualStmt = null;
-        String actualString = null;
-        try {
-            actualStmt = QueryParser.getQueryParser().parseStatement(stmt);
-            actualString = actualStmt.toString();
-                
-        } catch(Throwable e) { 
-            fail("Exception during parsing (" + e.getClass().getName() + "): " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
+    private void helpStmtTest(String stmt, String expectedString, Statement expectedStmt) throws ParseException {
+        Statement actualStmt = new SQLParser(new StringReader(stmt)).statement(new ParseInfo());
+        String actualString = actualStmt.toString();
         assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
         assertEquals("Language objects do not match: ", expectedStmt, actualStmt);              //$NON-NLS-1$
     }
@@ -3184,10 +3149,8 @@
     /** 
      * Try nesting subquery in double parentheses - parsing fails.  'exec' is not handled as
      * robustly as other types of commands that can appear in a from clause subquery. 
-     * 
-     * deferred, not important enough 
      */
-    public void DEFERRED_testStoredQuerySubqueryMultipleParens(){
+    public void testStoredQuerySubqueryMultipleParens(){
         StoredProcedure storedQuery = new StoredProcedure();
         storedQuery.setProcedureName("proc1"); //$NON-NLS-1$
         SPParameter parameter = new SPParameter(1, new Constant("param1")); //$NON-NLS-1$
@@ -3205,14 +3168,14 @@
         helpTest("SELECT X.A FROM ((exec proc1('param1'))) AS X", "SELECT X.A FROM (EXEC proc1('param1')) AS X", query); //$NON-NLS-1$ //$NON-NLS-2$
     }    
     
-    @Test public void testErrorStatement(){
+    @Test public void testErrorStatement() throws Exception {
         RaiseErrorStatement errStmt = new RaiseErrorStatement(new Constant("Test only")); //$NON-NLS-1$
                  
         helpStmtTest("ERROR 'Test only';", "ERROR 'Test only';", //$NON-NLS-1$ //$NON-NLS-2$
             errStmt);           
     }
     
-    @Test public void testIfStatement(){
+    @Test public void testIfStatement() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String shortType = new String("short"); //$NON-NLS-1$
         Statement ifStmt = new DeclareStatement(a, shortType);
@@ -3264,7 +3227,7 @@
              stmt);     
     }*/   
     
-    @Test public void testCriteriaSelector0(){
+    @Test public void testCriteriaSelector0() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3274,7 +3237,7 @@
         helpCriteriaSelectorTest("IS NULL CRITERIA ON (a)", "IS NULL CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector1(){
+    @Test public void testCriteriaSelector1() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3284,7 +3247,7 @@
         helpCriteriaSelectorTest("= CRITERIA ON (a)", "= CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector2(){
+    @Test public void testCriteriaSelector2() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3294,7 +3257,7 @@
         helpCriteriaSelectorTest("<> CRITERIA ON (a)", "<> CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector3(){
+    @Test public void testCriteriaSelector3() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3304,7 +3267,7 @@
         helpCriteriaSelectorTest("< CRITERIA ON (a)", "< CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector4(){
+    @Test public void testCriteriaSelector4() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3314,7 +3277,7 @@
         helpCriteriaSelectorTest("> CRITERIA ON (a)", "> CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector5(){
+    @Test public void testCriteriaSelector5() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3324,7 +3287,7 @@
         helpCriteriaSelectorTest(">= CRITERIA ON (a)", ">= CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector6(){
+    @Test public void testCriteriaSelector6() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3334,7 +3297,7 @@
         helpCriteriaSelectorTest("<= CRITERIA ON (a)", "<= CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector7(){
+    @Test public void testCriteriaSelector7() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3345,7 +3308,7 @@
     }
     
     
-    @Test public void testCriteriaSelector8(){
+    @Test public void testCriteriaSelector8() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3355,7 +3318,7 @@
         helpCriteriaSelectorTest("IN CRITERIA ON (a)", "IN CRITERIA ON (a)", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
 
-    @Test public void testCriteriaSelector9(){
+    @Test public void testCriteriaSelector9() throws Exception {
         //ElementSymbol a = new ElementSymbol("a");
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3365,7 +3328,7 @@
         helpCriteriaSelectorTest("CRITERIA", "CRITERIA", critSelector);     //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testCriteriaSelector10(){
+    @Test public void testCriteriaSelector10() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         
         CriteriaSelector critSelector = new CriteriaSelector();
@@ -3376,7 +3339,7 @@
     }
 
     /**HAS IS NULL CRITERIA ON (a)*/    
-    @Test public void testHasIsNullCriteria(){
+    @Test public void testHasIsNullCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3393,7 +3356,7 @@
     }   
     
     /**HAS LIKE CRITERIA ON (a)*/    
-    @Test public void testHasLikeCriteria(){
+    @Test public void testHasLikeCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3409,7 +3372,7 @@
             hasSelector);
     }  
             
-    @Test public void testHasEQCriteria(){
+    @Test public void testHasEQCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3425,7 +3388,7 @@
             hasSelector);
     }    
     
-    @Test public void testHasNECriteria(){
+    @Test public void testHasNECriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3442,7 +3405,7 @@
     }    
     
     /**HAS IN CRITERIA ON (a)*/    
-    @Test public void testHasInCriteria(){
+    @Test public void testHasInCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3459,7 +3422,7 @@
     }   
      
     /**HAS COMPARE_LT CRITERIA ON (a)*/    
-    @Test public void testHasLTCriteria(){
+    @Test public void testHasLTCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3476,7 +3439,7 @@
     }   
     
     /**HAS COMPARE_LE CRITERIA ON (a)*/    
-    @Test public void testHasLECriteria(){
+    @Test public void testHasLECriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3493,7 +3456,7 @@
     }   
     
     /**HAS COMPARE_GT CRITERIA ON (a)*/    
-    @Test public void testHasGTCriteria(){
+    @Test public void testHasGTCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3510,7 +3473,7 @@
     }   
        
     /**HAS COMPARE_GE CRITERIA ON (a)*/    
-    @Test public void testHasGECriteria(){
+    @Test public void testHasGECriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3527,7 +3490,7 @@
     }   
          
     /**HAS BETWEEN CRITERIA ON (a)*/    
-    @Test public void testHasBetweenCriteria(){
+    @Test public void testHasBetweenCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3543,7 +3506,7 @@
             hasSelector);
     }   
          
-    @Test public void testTranslateCriteria(){
+    @Test public void testTranslateCriteria() throws Exception {
         ElementSymbol a = new ElementSymbol("a");              //$NON-NLS-1$
         List elements = new ArrayList();
         elements.add(a);
@@ -3569,7 +3532,7 @@
             
     }
     
-    @Test public void testAssignStatement(){
+    @Test public void testAssignStatement() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
        
         List symbols = new ArrayList();
@@ -3600,7 +3563,7 @@
         helpStmtTest("a = 'aString';", "a = 'aString';", exprStmt);      //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-     @Test public void testAssignStatement2(){
+     @Test public void testAssignStatement2() throws Exception {
         Insert insert = new Insert();
         insert.setGroup(new GroupSymbol("g")); //$NON-NLS-1$
         List vars = new ArrayList();
@@ -3619,7 +3582,7 @@
            
     }
     
-    @Test public void testDeclareStatement(){
+    @Test public void testDeclareStatement() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String type = new String("short"); //$NON-NLS-1$
         DeclareStatement stmt = new DeclareStatement(a, type);
@@ -3627,7 +3590,7 @@
         helpStmtTest("DECLARE short a;","DECLARE short a;", stmt); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testDeclareStatementWithAssignment(){
+    @Test public void testDeclareStatementWithAssignment() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String type = new String("short"); //$NON-NLS-1$
         DeclareStatement stmt = new DeclareStatement(a, type, new Constant(null));
@@ -3635,7 +3598,7 @@
         helpStmtTest("DECLARE short a = null;","DECLARE short a = null;", stmt); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testDeclareStatementWithAssignment1(){
+    @Test public void testDeclareStatementWithAssignment1() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String type = new String("string"); //$NON-NLS-1$
         DeclareStatement stmt = new DeclareStatement(a, type, sampleQuery());
@@ -3643,7 +3606,7 @@
         helpStmtTest("DECLARE string a = SELECT a1 FROM g WHERE a2 = 5;","DECLARE string a = SELECT a1 FROM g WHERE a2 = 5;", stmt); //$NON-NLS-1$ //$NON-NLS-2$
     }
       
-    @Test public void testStatement() {
+    @Test public void testStatement() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String type = new String("short"); //$NON-NLS-1$
         DeclareStatement declStmt = new DeclareStatement(a, type);
@@ -3653,7 +3616,7 @@
             stmt);
     }
         
-    @Test public void testBlock() {
+    @Test public void testBlock() throws Exception {
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
         String type = new String("short"); //$NON-NLS-1$
         DeclareStatement declStmt = new DeclareStatement(a, type);
@@ -3664,7 +3627,7 @@
             block);
     }
        
-    @Test public void testCommandStatement(){
+    @Test public void testCommandStatement() throws Exception {
         Query query = sampleQuery();
         
         Command sqlCmd = query;
@@ -3695,7 +3658,7 @@
         return query;
     }
     
-    @Test public void testDynamicCommandStatement(){
+    @Test public void testDynamicCommandStatement() throws Exception {
         List symbols = new ArrayList();
 
         ElementSymbol a1 = new ElementSymbol("a1"); //$NON-NLS-1$
@@ -3718,7 +3681,7 @@
     }
     
     //sql is a variable, also uses the as, into, and update clauses
-    @Test public void testDynamicCommandStatement1(){
+    @Test public void testDynamicCommandStatement1() throws Exception {
         List symbols = new ArrayList();
         
         ElementSymbol a1 = new ElementSymbol("a1"); //$NON-NLS-1$
@@ -3746,7 +3709,7 @@
         cmdStmt);       
     }
     
-    @Test public void testDynamicCommandStatementWithUsing(){
+    @Test public void testDynamicCommandStatementWithUsing() throws Exception {
         SetClauseList using = new SetClauseList();
         
         ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
@@ -5478,7 +5441,7 @@
         helpTest(sql, sqlExpected, query);        
     }      
       
-    @Test public void testLoopStatement(){
+    @Test public void testLoopStatement() throws Exception {
         GroupSymbol g = new GroupSymbol("m.g"); //$NON-NLS-1$
         From from = new From();
         from.addGroup(g);
@@ -5510,7 +5473,7 @@
              +"\n"+"END", loopStmt);      //$NON-NLS-1$ //$NON-NLS-2$
     }  
 
-    @Test public void testLoopStatementWithOrderBy(){
+    @Test public void testLoopStatementWithOrderBy() throws Exception {
         GroupSymbol g = new GroupSymbol("m.g"); //$NON-NLS-1$
         From from = new From();
         from.addGroup(g);
@@ -5546,7 +5509,7 @@
              +"\n"+"END", loopStmt);      //$NON-NLS-1$ //$NON-NLS-2$
     }  
     
-    @Test public void testWhileStatement(){
+    @Test public void testWhileStatement() throws Exception {
         ElementSymbol x = new ElementSymbol("x", false); //$NON-NLS-1$
         Function f = new Function("+", new Expression[] { x, new Constant(new Integer(1)) }); //$NON-NLS-1$
         Statement assignmentStmt = new AssignmentStatement(x, f);
@@ -5560,12 +5523,12 @@
                      +"\n"+"END", whileStmt); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testBreakStatement(){
+    @Test public void testBreakStatement() throws Exception {
         Statement breakStmt = new BreakStatement();
         helpStmtTest("break;", "BREAK;", breakStmt); //$NON-NLS-1$ //$NON-NLS-2$
     }
     
-    @Test public void testContinueStatement(){
+    @Test public void testContinueStatement() throws Exception {
         Statement contStmt = new ContinueStatement();
         helpStmtTest("continue;", "CONTINUE;", contStmt); //$NON-NLS-1$ //$NON-NLS-2$
     }

Modified: trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/test/java/com/metamatrix/query/processor/proc/TestProcedureProcessor.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -109,14 +109,12 @@
         }
     }
     
-    static void helpTestProcess(boolean optimistic, ProcessorPlan procPlan, int rowsUpdated, List[] expectedResults, boolean shouldFail, 
-    		ProcessorDataManager dataMgr) throws SQLException, MetaMatrixCoreException {
+    static void helpTestProcess(ProcessorPlan procPlan, int rowsUpdated, List[] expectedResults, boolean shouldFail, ProcessorDataManager dataMgr) throws SQLException, MetaMatrixCoreException {
         // Process twice, testing reset and clone method of Processor plan
         for (int i=1; i<=2; i++) {
 	        BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager();
             CommandContext context = new CommandContext("pID", null, null, null, null); //$NON-NLS-1$
             context.getNextRand(0);
-            context.setOptimisticTransaction(optimistic);
             context.setProcessDebug(DEBUG);
             QueryProcessor processor = new QueryProcessor(procPlan, context, bufferMgr, dataMgr);
             TupleSourceID tsID = processor.getResultsID();  
@@ -194,12 +192,12 @@
     }
     
     private void helpTestProcess(ProcessorPlan procPlan, int expectedRows, FakeDataManager dataMgr) throws SQLException, MetaMatrixCoreException {
-        helpTestProcess(false, procPlan, expectedRows, null, false, dataMgr);
+        helpTestProcess(procPlan, expectedRows, null, false, dataMgr);
     }
     
     static void helpTestProcess(boolean optimistic, ProcessorPlan procPlan, List[] expectedResults, 
     		ProcessorDataManager dataMgr, boolean shouldFail) throws SQLException, MetaMatrixCoreException {
-        helpTestProcess(optimistic, procPlan, 0, expectedResults, shouldFail, dataMgr);
+        helpTestProcess(procPlan, 0, expectedResults, shouldFail, dataMgr);
     }
 
     // Helper to create a list of elements - used in creating sample data
@@ -1654,38 +1652,7 @@
     	
         helpTestProcessFailure(false, plan, dataMgr, "Couldn't execute the dynamic SQL command \"EXECUTE STRING 'select e1 from pm1.g1'\" with the SQL statement \"'select e1 from pm1.g1'\" due to: The datatype 'string' for element 'E1' in the dynamic SQL cannot be implicitly converted to 'integer'."); //$NON-NLS-1$
      }
- 
-    @Test public void testDynamicCommandInvalidModelUpdateCountEqualOne() throws Exception {
-    	//Test invalid update model count
-    	//Set update model count to 1 while actual is 2   
-        FakeMetadataFacade metadata = FakeMetadataFactory.example1();
-        
-        FakeMetadataObject pm1 = metadata.getStore().findObject("pm1",FakeMetadataObject.MODEL); //$NON-NLS-1$
-        
-        FakeMetadataObject rs2 = FakeMetadataFactory.createResultSet("pm1.rs1", pm1, new String[] { "e1" }, new String[] { DataTypeManager.DefaultDataTypes.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
-        FakeMetadataObject rs2p1 = FakeMetadataFactory.createParameter("ret", 1, ParameterInfo.RESULT_SET, DataTypeManager.DefaultDataTypes.OBJECT, rs2);  //$NON-NLS-1$
-        FakeMetadataObject rs2p2 = FakeMetadataFactory.createParameter("in", 2, ParameterInfo.IN, DataTypeManager.DefaultDataTypes.STRING, null);  //$NON-NLS-1$
-        QueryNode sq2n1 = new QueryNode("pm1.sq1", "CREATE VIRTUAL PROCEDURE BEGIN\n" //$NON-NLS-1$ //$NON-NLS-2$
-                                        + "INSERT INTO pm1.g1 (e1) VALUES (pm1.sq1.in);UPDATE pm1.g2 SET e1 = 'Next'; END"); //$NON-NLS-1$ 
-        FakeMetadataObject sq1 = FakeMetadataFactory.createVirtualProcedure("pm1.sq1", pm1, Arrays.asList(new FakeMetadataObject[] { rs2p1, rs2p2 }), sq2n1);  //$NON-NLS-1$
-        
-        QueryNode sq2n2 = new QueryNode("pm1.sq2", "CREATE VIRTUAL PROCEDURE BEGIN\n" //$NON-NLS-1$ //$NON-NLS-2$
-                + "execute string 'EXEC pm1.sq1(''First'')' as e1 string  UPDATE 1; END"); //$NON-NLS-1$ 
-        FakeMetadataObject sq2 = FakeMetadataFactory.createVirtualProcedure("pm1.sq2", pm1, Arrays.asList(new FakeMetadataObject[] { rs2p1, rs2p2 }), sq2n2);  //$NON-NLS-1$
-
-        metadata.getStore().addObject(rs2);
-        metadata.getStore().addObject(sq1);
-        metadata.getStore().addObject(sq2);
-        
-        String userUpdateStr = "EXEC pm1.sq2('test')"; //$NON-NLS-1$
-        
-        FakeDataManager dataMgr = exampleDataManager(metadata);
-
-        ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
-    	
-        helpTestProcessFailure(true, plan, dataMgr, "Couldn't execute the dynamic SQL command \"EXECUTE STRING 'EXEC pm1.sq1(''First'')' AS e1 string UPDATE 1\" with the SQL statement \"'EXEC pm1.sq1(''First'')'\" due to: The actual model update count '2' is greater than the expected value of '1'.  This is potentially unsafe in OPTIMISTIC transaction mode.  Please adjust the UPDATE clause of the dynamic SQL statement."); //$NON-NLS-1$ 
-      }
-    
+     
     @Test public void testDynamicCommandWithTwoDynamicStatements() throws Exception {
     	//Tests dynamic query with two consecutive DynamicCommands. The first without an AS clause and returning different results. 
         FakeMetadataFacade metadata = FakeMetadataFactory.example1();

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java	2009-12-14 18:21:21 UTC (rev 1661)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java	2009-12-14 18:48:26 UTC (rev 1662)
@@ -209,7 +209,7 @@
     
 	public void helpTestVisibilityFails(String sql) throws Exception {
         RequestMessage reqMsg = exampleRequestMessage(sql); 
-        reqMsg.setTxnAutoWrapMode(ExecutionProperties.AUTO_WRAP_OFF);
+        reqMsg.setTxnAutoWrapMode(ExecutionProperties.TXN_WRAP_OFF);
         Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);
         ResultsMessage results = message.get(50000, TimeUnit.MILLISECONDS);
         assertEquals("[QueryValidatorException]Group does not exist: BQT3.SmallA", results.getException().toString()); //$NON-NLS-1$
@@ -235,7 +235,7 @@
         RequestMessage reqMsg = exampleRequestMessage(sql);
         DQPWorkContext.getWorkContext().setSessionToken(new SessionToken(new MetaMatrixSessionID(sessionid), userName));
         if (txnAutoWrap) {
-        	reqMsg.setTxnAutoWrapMode(ExecutionProperties.AUTO_WRAP_ON);
+        	reqMsg.setTxnAutoWrapMode(ExecutionProperties.TXN_WRAP_ON);
         }
 
         Future<ResultsMessage> message = core.executeRequest(reqMsg.getExecutionId(), reqMsg);



More information about the teiid-commits mailing list