[teiid-commits] teiid SVN: r1148 - in trunk: cache-jbosscache/src/main/java/com/metamatrix/cache/jboss and 28 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Jul 17 13:57:06 EDT 2009


Author: rareddy
Date: 2009-07-17 13:57:05 -0400 (Fri, 17 Jul 2009)
New Revision: 1148

Modified:
   trunk/build/kit-embedded/deploy.properties
   trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCacheFactory.java
   trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
   trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
   trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java
   trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java
   trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
   trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java
   trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java
   trunk/embedded/src/main/resources/com/metamatrix/dqp/embedded/i18n.properties
   trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java
   trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
   trunk/embedded/src/test/resources/admin/buffertest1.properties
   trunk/embedded/src/test/resources/admin/buffertest2.properties
   trunk/embedded/src/test/resources/admin/buffertest3.properties
   trunk/embedded/src/test/resources/bqt/fakebqt.properties
   trunk/embedded/src/test/resources/dqp/dqp.properties
   trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java
   trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
   trunk/engine/src/main/java/org/teiid/dqp/internal/cache/DQPContextCache.java
   trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeBufferService.java
   trunk/engine/src/test/java/org/teiid/dqp/internal/cache/TestDQPContextCache.java
   trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java
   trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestDataEntitlements.java
   trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java
   trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestPartsDatabaseMetadata.java
   trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestResultSetMetadata.java
   trunk/test-integration/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataInConnector.java
   trunk/test-integration/src/test/resources/3473/3473.properties
   trunk/test-integration/src/test/resources/authcheck/bqt.properties
   trunk/test-integration/src/test/resources/bqt/bqt.properties
   trunk/test-integration/src/test/resources/dqp/dqp.properties
   trunk/test-integration/src/test/resources/metadata/dqp.properties
   trunk/test-integration/src/test/resources/partssupplier/dqp.properties
   trunk/test-integration/src/test/resources/vdbless/dqp.properties
   trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties
   trunk/test-integration/src/test/resources/xquery/xquery.properties
   trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java
   trunk/txn-jbossts/src/test/java/com/metamatrix/xa/arjuna/TestArjunaRecovery.java
Log:
TEIID-722, TEIID-679 : Fixed the instance name of the instance based on the process name rather than an automatic integer identifier.  Also, exposed the transaction Manager properties in the deploy properties

Modified: trunk/build/kit-embedded/deploy.properties
===================================================================
--- trunk/build/kit-embedded/deploy.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/build/kit-embedded/deploy.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -144,3 +144,9 @@
 #ssl.truststore.filename=teiid.truststore
 #ssl.truststore.Password=changeme
 #client.encryption.enabled=true
+
+
+# transaction time out in seconds
+#xa.enabled=true
+#xa.max_timeout=120
+#xa.enable_recovery=true
\ No newline at end of file

Modified: trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCacheFactory.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCacheFactory.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -34,6 +34,7 @@
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
+import com.google.inject.name.Named;
 import com.metamatrix.cache.Cache;
 import com.metamatrix.cache.CacheConfiguration;
 import com.metamatrix.cache.CacheFactory;
@@ -48,20 +49,18 @@
 	private static final String NAME = "Cache"; //$NON-NLS-1$
 	private org.jboss.cache.Cache cacheStore;
 	private volatile boolean destroyed = false;
+	private JMXUtil jmx; 
 	
 	@Inject
-	JMXUtil jmx;
-	
-	@Inject
-	public JBossCacheFactory(org.jboss.cache.Cache cacheStore) {
-		try {
-			jmx.register(JMXUtil.MBeanType.SERVICE, NAME, cacheStore); 
-			cacheStore.create();
-			cacheStore.start();
-			this.cacheStore =  cacheStore;
-		} catch (FailedToRegisterException e) {
-			throw new MetaMatrixRuntimeException(e.getCause());
-		}
+	public JBossCacheFactory(org.jboss.cache.Cache cacheStore, @Named("jmx") JMXUtil jmx) {
+		this.cacheStore =  cacheStore;
+//		try {
+//			this.jmx = jmx;
+//			//jmx.register(JMXUtil.MBeanType.SERVICE, NAME, cacheStore); 
+//			this.cacheStore =  cacheStore;
+//		} catch (FailedToRegisterException e) {
+//			throw new MetaMatrixRuntimeException(e.getCause());
+//		}
 	}
 
 	/**
@@ -110,13 +109,13 @@
 	}    
 	
 	public void destroy() {
-		try {
-			jmx.unregister(JMXUtil.MBeanType.SERVICE, NAME);
-		} catch (FailedToRegisterException e) {
-		} finally {
-			this.cacheStore.destroy();
-			this.destroyed = true;
-		}
+//		try {
+//			jmx.unregister(JMXUtil.MBeanType.SERVICE, NAME);
+//		} catch (FailedToRegisterException e) {
+//		} finally {
+//			this.cacheStore.destroy();
+//			this.destroyed = true;
+//		}
 	}	
 	
 }

Modified: trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/client/src/main/java/com/metamatrix/dqp/embedded/DQPEmbeddedProperties.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -47,7 +47,6 @@
     public static final String OUTPUT_BUFFER_SIZE = "server.outputBufferSize"; //$NON-NLS-1$       
     
     //derived properties
-    public static final String DQP_IDENTITY = "dqp.identity"; //$NON-NLS-1$
     public static final String DQP_TMPDIR = "mm.io.tmpdir"; //$NON-NLS-1$
     public static final String BOOTURL = "bootURL"; //$NON-NLS-1$
     public static final String ENABLE_SOCKETS = "sockets.enabled"; //$NON-NLS-1$

Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedConfigurationService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -942,7 +942,7 @@
         try {
             this.setUserPreferences(PropertiesUtils.clone(properties));
                         
-            DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.dqp_loading", new Object[] {getInstanceIdenifier()}); //$NON-NLS-1$
+            DQPEmbeddedPlugin.logInfo("EmbeddedConfigurationService.dqp_loading", new Object[] {getProcessName()}); //$NON-NLS-1$
             
             // initialize encryption
             initializeEncryption();
@@ -1008,12 +1008,7 @@
      */
     public URL[] getVDBLocations() {
         ArrayList vdbs = new ArrayList();
-        addVDBs(vdbs, getUserPreferences().getProperty(DQPEmbeddedProperties.VDB_DEFINITION));
-        addVDBs(vdbs, getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_DEPLOYDIR));
-        return (URL[])vdbs.toArray(new URL[vdbs.size()]);
-    }
-
-	private void addVDBs(ArrayList vdbs, String vdbProperty) {
+        String vdbProperty = getUserPreferences().getProperty(DQPEmbeddedProperties.VDB_DEFINITION); 
 		if (vdbProperty != null  && vdbProperty.length() != 0) {
             StringTokenizer st = new StringTokenizer(vdbProperty, VDB_LIST_SEPARATOR);
             while( st.hasMoreTokens() ) {
@@ -1027,7 +1022,8 @@
                 vdbs.add(vdbURL);
             }            
         }
-	}
+        return (URL[])vdbs.toArray(new URL[vdbs.size()]);
+    }
  
     /**
      * Load the Connector Bindings from the VDBS and ServerConfig.xml
@@ -1389,7 +1385,6 @@
     private File getWorkDir() {
         String workDirectory = getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_WORKDIR);
         File workDir = new File(workDirectory);
-        workDir.mkdirs();
         return workDir;
     }
     
@@ -1417,10 +1412,10 @@
     }
     
     /**  
-     * @see com.metamatrix.dqp.service.ConfigurationService#getInstanceIdenifier()
+     * @see com.metamatrix.dqp.service.ConfigurationService#getProcessName()
      */
-    public String getInstanceIdenifier() {
-        return getUserPreferences().getProperty(DQPEmbeddedProperties.DQP_IDENTITY);
+    public String getProcessName() {
+        return getUserPreferences().getProperty(DQPEmbeddedProperties.PROCESSNAME);
     }
     
     

Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedTransactionService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -34,15 +34,12 @@
 
 public class EmbeddedTransactionService extends TransactionServerImpl {
 
-    public static final String TRANSACTIONS_ENABLED = "metamatrix.xatxnmgr.enabled"; //$NON-NLS-1$
-    
     @Override
     public void initialize(Properties props)
     		throws ApplicationInitializationException {
         try {
         	props = new Properties(props);
-            props.setProperty(TransactionService.HOSTNAME, "dqp"); //$NON-NLS-1$
-            props.setProperty(TransactionService.VMNAME, props.getProperty(DQPEmbeddedProperties.DQP_IDENTITY));
+            props.setProperty(TransactionService.PROCESSNAME, props.getProperty(DQPEmbeddedProperties.PROCESSNAME));
             props.setProperty(TransactionService.TXN_STORE_DIR, props.getProperty(DQPEmbeddedProperties.DQP_WORKDIR));
             this.setTransactionProvider(ArjunaTransactionProvider.getInstance(props));
         } catch (XATransactionException e) {

Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/CacheProvider.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -47,6 +47,8 @@
 		String workspaceDir = this.props.getProperty(DQPEmbeddedProperties.DQP_WORKDIR);
 		p.setProperty("location", workspaceDir + "/cache"); //$NON-NLS-1$ //$NON-NLS-2$
 		configs.get(0).setProperties(p);
+		cache.create();
+		cache.start();
 		return cache;
 	}
 }

Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedConnectionFactoryImpl.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -26,11 +26,13 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.RandomAccessFile;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.InetAddress;
 import java.net.URL;
+import java.nio.channels.FileChannel;
 import java.util.Date;
 import java.util.Properties;
 
@@ -101,7 +103,7 @@
     		initialize(connectionProperties);
             return new LocalServerConnection(connectionProperties, this.clientServices);
     	} catch (ApplicationInitializationException e) {
-            throw new ConnectionException(e.getCause());
+            throw new ConnectionException(e, e.getMessage());
 		}
 	}
     
@@ -120,21 +122,22 @@
     		return;
     	}
         
-        String dqpId = getDQPIdentity(info);
-        info.setProperty(DQPEmbeddedProperties.DQP_IDENTITY, dqpId);
-    	
         URL bootstrapURL = null;
         Properties props = info;
-
+        String processName = "embedded"; //$NON-NLS-1$
+        
         try {
 			bootstrapURL = URLHelper.buildURL(info.getProperty(DQPEmbeddedProperties.BOOTURL));
 			props = PropertiesUtils.loadFromURL(bootstrapURL);
 			props.putAll(info);
 			props = PropertiesUtils.resolveNestedProperties(props);
 			
+			processName = props.getProperty(DQPEmbeddedProperties.PROCESSNAME, processName); 
+			props.setProperty(DQPEmbeddedProperties.PROCESSNAME, processName);
+			
 	        // Create a temporary workspace directory
 			String teiidHome = info.getProperty(DQPEmbeddedProperties.TEIID_HOME);
-	        this.workspaceDirectory = createWorkspace(teiidHome, props.getProperty(DQPEmbeddedProperties.DQP_WORKDIR, "work"), dqpId); //$NON-NLS-1$
+	        this.workspaceDirectory = createWorkspace(teiidHome, props.getProperty(DQPEmbeddedProperties.DQP_WORKDIR, "work"), processName); //$NON-NLS-1$
 	        props.setProperty(DQPEmbeddedProperties.DQP_WORKDIR, this.workspaceDirectory);
 	        
 	        // create the deploy directories
@@ -142,17 +145,28 @@
 	        props.setProperty(DQPEmbeddedProperties.DQP_DEPLOYDIR, deployDirectory.getCanonicalPath());
 	        deployDirectory.mkdirs();
 	        
+	        // if there is no separate vdb-definitions specified then use the deploy directory as the location of the vdb
+	        String vdbDefinitions = props.getProperty(DQPEmbeddedProperties.VDB_DEFINITION);
+	        if (vdbDefinitions == null) {
+	        	props.setProperty(DQPEmbeddedProperties.VDB_DEFINITION, deployDirectory.getCanonicalPath());
+	        }
+	        
 	        // create log directory
 	        File logDirectory = new File(teiidHome, props.getProperty(DQPEmbeddedProperties.DQP_LOGDIR, "log")); //$NON-NLS-1$
 	        props.setProperty(DQPEmbeddedProperties.DQP_LOGDIR, logDirectory.getCanonicalPath());
 	        deployDirectory.mkdirs();
-	        
+	    	        
 		} catch (IOException e) {
 			throw new ApplicationInitializationException(e);
 		}
-		        	
-        this.jmxServer = new JMXUtil(dqpId);
-        
+		
+		// check for a duplicate process and exit if one found.
+		if(isDuplicateProcess(processName)) {
+			throw new ApplicationInitializationException(DQPEmbeddedPlugin.Util.getString("DQPEmbeddedManager.duplicate_process", processName)); //$NON-NLS-1$
+		}
+		
+		this.jmxServer = new JMXUtil(processName);
+		
         EmbeddedGuiceModule config = new EmbeddedGuiceModule(bootstrapURL, props, this.jmxServer);
 		Injector injector = Guice.createInjector(config);
 		ResourceFinder.setInjector(injector);
@@ -187,6 +201,18 @@
         DQPEmbeddedPlugin.logInfo("DQPEmbeddedManager.start_dqp", new Object[] {new Date(System.currentTimeMillis()).toString()}); //$NON-NLS-1$
     }
     
+	private boolean isDuplicateProcess(String processName) {
+		try {
+			File f = new File(this.workspaceDirectory, "teiid_"+processName+".pid"); //$NON-NLS-1$ //$NON-NLS-2$			
+			FileChannel channel = new RandomAccessFile(f, "rw").getChannel(); //$NON-NLS-1$
+			return (channel.tryLock() == null); 
+		} catch (Exception e) {
+			// ignore
+		}
+		return true;
+	}
+
+
 	private ClientServiceRegistry createClientServices(ConfigurationService configService) {
     	ClientServiceRegistry services  = new ClientServiceRegistry();
     
@@ -202,36 +228,16 @@
 	}
     
     /**
-     * Define an identifier for the DQP 
-     * @return a JVM level unique identifier
-     */
-    private String getDQPIdentity(Properties props) {
-    	
-    	String processName = props.getProperty(DQPEmbeddedProperties.PROCESSNAME);
-    	if (processName != null) {
-    		return processName;
-    	}
-    	
-    	synchronized (System.class) {
-            String id = System.getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "1"); //$NON-NLS-1$
-            int identity = Integer.parseInt(id);
-            System.setProperty(DQPEmbeddedProperties.DQP_IDENTITY, String.valueOf(identity + 1));
-            id = String.valueOf(identity);
-            return id;
-    	}
-    }        
-    
-    /**
      * Create the temporary workspace directory for the dqp  
      * @param identity - identity of the dqp
      * @throws MMSQLException 
      */
     private String createWorkspace(String teiidHome, String baseDir, String identity) throws IOException {
 		File baseFile = new File(teiidHome, baseDir);
-
-		System.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, baseFile.getCanonicalPath() + "/temp"); //$NON-NLS-1$S 
-
+		
         File f = new File(baseFile, identity);
+        
+        System.setProperty(DQPEmbeddedProperties.DQP_TMPDIR, f.getCanonicalPath() + "/temp"); //$NON-NLS-1$S
 
         // If directory already exists then try to delete it; because we may have
         // failed to delete at end of last run (JVM holds lock on jar files)

Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/EmbeddedGuiceModule.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -58,6 +58,7 @@
 import com.metamatrix.dqp.embedded.services.EmbeddedTransactionService;
 import com.metamatrix.dqp.embedded.services.EmbeddedVDBService;
 import com.metamatrix.dqp.service.DQPServiceNames;
+import com.metamatrix.dqp.service.TransactionService;
 import com.metamatrix.platform.security.api.AuthorizationPolicy;
 import com.metamatrix.platform.security.authorization.service.AdminAuthorizationPolicyProvider;
 import com.metamatrix.platform.security.authorization.service.AuthorizationServiceImpl;
@@ -83,10 +84,8 @@
 		bind(LogListener.class).toProvider(LogListernerProvider.class).in(Scopes.SINGLETON);  
 		
 		bind(URL.class).annotatedWith(Names.named("BootstrapURL")).toInstance(bootstrapURL); //$NON-NLS-1$
-		bindConstant().annotatedWith(Names.named("HostName")).to("embedded"); //$NON-NLS-1$ //$NON-NLS-2$
-		bindConstant().annotatedWith(Names.named("ProcessName")).to(props.getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "test")); //$NON-NLS-1$ //$NON-NLS-2$
 		bind(Properties.class).annotatedWith(Names.named("DQPProperties")).toInstance(this.props); //$NON-NLS-1$
-		bind(JMXUtil.class).toInstance(this.jmx);
+		bind(JMXUtil.class).annotatedWith(Names.named("jmx")).toInstance(this.jmx); //$NON-NLS-1$
 
 		InetAddress address = resolveHostAddress(props.getProperty(DQPEmbeddedProperties.BIND_ADDRESS));
 		bind(InetAddress.class).annotatedWith(Names.named(DQPEmbeddedProperties.HOST_ADDRESS)).toInstance(address);
@@ -136,7 +135,7 @@
 	}
 	
 	private Map<String, Class<? extends ApplicationService>> getDefaultServiceClasses() {
-		boolean useTxn = PropertiesUtils.getBooleanProperty(props, EmbeddedTransactionService.TRANSACTIONS_ENABLED, true);
+		boolean useTxn = PropertiesUtils.getBooleanProperty(props, TransactionService.TRANSACTIONS_ENABLED, true);
 		
 		Map<String, Class<? extends ApplicationService>> result = new HashMap<String, Class<? extends ApplicationService>>();
 		result.put(DQPServiceNames.CONFIGURATION_SERVICE, EmbeddedConfigurationService.class);

Modified: trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/java/com/metamatrix/jdbc/LogListernerProvider.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -43,9 +43,9 @@
 	@Override
 	public LogListener get() {
         String logDirectory = this.props.getProperty(DQPEmbeddedProperties.DQP_LOGDIR);
-        String instanceId = this.props.getProperty(DQPEmbeddedProperties.DQP_IDENTITY, "0"); //$NON-NLS-1$        
+        String processName = this.props.getProperty(DQPEmbeddedProperties.PROCESSNAME);        
 
-    	File logFile = new File(logDirectory, "teiid_"+instanceId+".log"); //$NON-NLS-1$ //$NON-NLS-2$
+    	File logFile = new File(logDirectory, "teiid_"+processName+".log"); //$NON-NLS-1$ //$NON-NLS-2$
     	System.setProperty("dqp.log4jFile", logFile.getAbsolutePath()); //$NON-NLS-1$ // hack
     	return new Log4jListener();
 	}

Modified: trunk/embedded/src/main/resources/com/metamatrix/dqp/embedded/i18n.properties
===================================================================
--- trunk/embedded/src/main/resources/com/metamatrix/dqp/embedded/i18n.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/main/resources/com/metamatrix/dqp/embedded/i18n.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -194,6 +194,7 @@
 
 DQPEmbeddedManager.start_dqp=DQP is started at time = {0}
 DQPEmbeddedManager.shutdown_dqp=DQP is shutdown at time = {0}
+DQPEmbeddedManager.duplicate_process= There is another process running with same name {0}; Failed to start. 
 
 ServerSecurityAdminImpl.User_name_too_long=The user name may not be null and cannot be longer than {0} charachters
 ServerSecurityAdminImpl.neither_User_nor_Group=Parameter memberType is neither a User nor a Group.

Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/EmbeddedTestUtil.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -36,8 +36,11 @@
 	
 	public static Properties getProperties() throws IOException {
 		Properties p = getProperties(UnitTestUtil.getTestScratchPath()+"/dqp/dqp.properties"); //$NON-NLS-1$
-        p.setProperty(DQPEmbeddedProperties.DQP_WORKDIR, System.getProperty("java.io.tmpdir")+"/teiid/1");         //$NON-NLS-1$ //$NON-NLS-2$
-        p.setProperty(DQPEmbeddedProperties.DQP_DEPLOYDIR, System.getProperty("java.io.tmpdir")+"/teiid/deploy");         //$NON-NLS-1$ //$NON-NLS-2$
+        p.setProperty(DQPEmbeddedProperties.DQP_WORKDIR, p.getProperty(DQPEmbeddedProperties.TEIID_HOME)+"/work"); //$NON-NLS-1$
+        p.setProperty(DQPEmbeddedProperties.DQP_DEPLOYDIR, p.getProperty(DQPEmbeddedProperties.TEIID_HOME)+"/deploy");  //$NON-NLS-1$
+        
+        new File(p.getProperty(DQPEmbeddedProperties.TEIID_HOME)+"/work").mkdirs(); //$NON-NLS-1$
+        new File(p.getProperty(DQPEmbeddedProperties.TEIID_HOME)+"/deploy").mkdirs(); //$NON-NLS-1$
         return p;
 	}
 	

Modified: trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java
===================================================================
--- trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/java/com/metamatrix/dqp/embedded/services/TestEmbeddedConfigurationService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -91,8 +91,8 @@
     }
     
     public void testGetAvailableVDBFiles() throws Exception {
-        service.setUserPreferences(EmbeddedTestUtil.getProperties()); 
-        HashMap vdbFiles = VDBConfigurationReader.loadVDBS(service.getVDBLocations(), new File(UnitTestUtil.getTestScratchPath()));
+        service.setUserPreferences(EmbeddedTestUtil.getProperties());
+        HashMap vdbFiles = VDBConfigurationReader.loadVDBS(service.getVDBLocations(), service.getDeployDir());
         int count = vdbFiles.keySet().size();
         assertEquals(2, count);   
         // admin.vdb is ignored because it did not have any models

Modified: trunk/embedded/src/test/resources/admin/buffertest1.properties
===================================================================
--- trunk/embedded/src/test/resources/admin/buffertest1.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/resources/admin/buffertest1.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -27,7 +27,7 @@
 dqp.logLevel=4
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/embedded/src/test/resources/admin/buffertest2.properties
===================================================================
--- trunk/embedded/src/test/resources/admin/buffertest2.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/resources/admin/buffertest2.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -30,7 +30,7 @@
 dqp.logLevel=4
 dqp.identity=1
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/embedded/src/test/resources/admin/buffertest3.properties
===================================================================
--- trunk/embedded/src/test/resources/admin/buffertest3.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/resources/admin/buffertest3.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -28,7 +28,7 @@
 dqp.logLevel=4
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 

Modified: trunk/embedded/src/test/resources/bqt/fakebqt.properties
===================================================================
--- trunk/embedded/src/test/resources/bqt/fakebqt.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/resources/bqt/fakebqt.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -11,7 +11,7 @@
 service.dqp.configuration.classname=com.metamatrix.dqp.service.FakeAbstractService
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 metamatrix.xatxnmgr.txnstore_dir=../../../../target/scratch
 
 

Modified: trunk/embedded/src/test/resources/dqp/dqp.properties
===================================================================
--- trunk/embedded/src/test/resources/dqp/dqp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/embedded/src/test/resources/dqp/dqp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -31,7 +31,7 @@
 dqp.buffer.connectorBatchSize=3868
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/ConfigurationService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -358,11 +358,11 @@
     public String getBufferMemorySize();
     
     /**
-     * Return some identifier which uniquely identifies the DQP. Usally this
-     * is an integer value which is set at the creation of the DQP 
+     * Return some identifier which uniquely identifies the DQP. Usually this
+     * is name given to this process 
      * @return unique number for DQP in a given JVM
      */
-    public String getInstanceIdenifier();    
+    public String getProcessName();    
     
 
     /**

Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -39,18 +39,19 @@
 import com.metamatrix.common.application.ApplicationService;
 import com.metamatrix.common.xa.MMXid;
 import com.metamatrix.common.xa.XATransactionException;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
 
 /**
  */
 public interface TransactionService extends ApplicationService {
-    public static final String MAX_TIMEOUT = "metamatrix.xatxnmgr.max_timeout"; //$NON-NLS-1$
-    public static final String TXN_STORE_DIR = "metamatrix.xatxnmgr.txnstore_dir"; //$NON-NLS-1$
-    public static final String TXN_STATUS_PORT = "metamatrix.xatxnmgr.txnstatus_port"; //$NON-NLS-1$
-    public static final String TXN_ENABLE_RECOVERY = "metamatrix.xatxnmgr.enable_recovery"; //$NON-NLS-1$
+	public static final String TRANSACTIONS_ENABLED = "xa.enabled"; //$NON-NLS-1$
+    public static final String MAX_TIMEOUT = "xa.max_timeout"; //$NON-NLS-1$
+    public static final String TXN_STORE_DIR = "xa.txnstore_dir"; //$NON-NLS-1$
+    public static final String TXN_STATUS_PORT = "xa.txnstatus_port"; //$NON-NLS-1$
+    public static final String TXN_ENABLE_RECOVERY = "xa.enable_recovery"; //$NON-NLS-1$
     
     
-    public static final String VMNAME = "metamatrix.xatxnmgr.vmname"; //$NON-NLS-1$
-    public static final String HOSTNAME = "metamatrix.xatxnmgr.hostname"; //$NON-NLS-1$
+    public static final String PROCESSNAME = DQPEmbeddedProperties.PROCESSNAME;
     
     public static final String DEFAULT_TXN_MGR_LOG_DIR = "txnlog"; //$NON-NLS-1$
     public static final String DEFAULT_TXN_TIMEOUT = "120"; //$NON-NLS-1$ //2 mins

Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/cache/DQPContextCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/cache/DQPContextCache.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/cache/DQPContextCache.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -21,6 +21,8 @@
  */
 package org.teiid.dqp.internal.cache;
 
+import java.util.Properties;
+
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
 import com.google.inject.name.Named;
@@ -28,6 +30,7 @@
 import com.metamatrix.cache.CacheConfiguration;
 import com.metamatrix.cache.CacheFactory;
 import com.metamatrix.cache.CacheConfiguration.Policy;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
 
 @Singleton
 public class DQPContextCache {
@@ -37,9 +40,9 @@
 	private String processIdentifier;
 	
 	@Inject
-	public DQPContextCache(@Named("HostName") String hostName, @Named("ProcessName") String processName, CacheFactory cacheFactory) {
+	public DQPContextCache(@Named("DQPProperties") Properties props, CacheFactory cacheFactory) {
 		this.cache = cacheFactory.get(Cache.Type.SCOPED_CACHE, new CacheConfiguration(Policy.LRU, 600, 10000));
-		this.processIdentifier = hostName + "-" + processName; //$NON-NLS-1$
+		this.processIdentifier = props.getProperty(DQPEmbeddedProperties.PROCESSNAME);
 	}
 	
 	public Cache getGlobalScopedCache() {

Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeBufferService.java
===================================================================
--- trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeBufferService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeBufferService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -22,6 +22,8 @@
 
 package com.metamatrix.dqp.service;
 
+import java.util.Properties;
+
 import org.teiid.dqp.internal.cache.DQPContextCache;
 
 import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -57,6 +59,6 @@
 
 	@Override
 	public DQPContextCache getContextCache() {
-		return new DQPContextCache("test", "test", new FakeCacheFactory()); //$NON-NLS-1$ //$NON-NLS-2$
+		return new DQPContextCache(new Properties(), new FakeCacheFactory()); 
 	}
 }

Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/cache/TestDQPContextCache.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/cache/TestDQPContextCache.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/cache/TestDQPContextCache.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -21,16 +21,15 @@
  */
 package org.teiid.dqp.internal.cache;
 
+import java.util.Properties;
+
 import junit.framework.TestCase;
 
-import org.teiid.connector.api.CacheScope;
-import org.teiid.connector.api.ExecutionContext;
-import org.teiid.dqp.internal.datamgr.impl.FakeExecutionContextImpl;
 import org.teiid.dqp.internal.process.DQPWorkContext;
 
 import com.metamatrix.cache.Cache;
 import com.metamatrix.cache.FakeCache.FakeCacheFactory;
-import com.metamatrix.dqp.message.RequestID;
+import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
 import com.metamatrix.platform.security.api.MetaMatrixSessionID;
 import com.metamatrix.platform.security.api.SessionToken;
 
@@ -41,7 +40,9 @@
 	
 	@Override
 	protected void setUp() throws Exception {
-		cacheContext = new DQPContextCache("host", "process", new FakeCacheFactory()); //$NON-NLS-1$ //$NON-NLS-2$
+		Properties p = new Properties();
+		p.setProperty(DQPEmbeddedProperties.PROCESSNAME, "host-process"); //$NON-NLS-1$
+		cacheContext = new DQPContextCache(p, new FakeCacheFactory());
 			
 	}
 	

Modified: trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/server/src/main/java/com/metamatrix/server/dqp/service/PlatformTransactionService.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -65,8 +65,7 @@
             }
             
             props.putAll(env);
-            props.setProperty(TransactionService.HOSTNAME, host.getFullName());
-            props.setProperty(TransactionService.VMNAME, CurrentConfiguration.getInstance().getProcessName());
+            props.setProperty(TransactionService.PROCESSNAME, CurrentConfiguration.getInstance().getProcessName());
             props.setProperty(TransactionService.TXN_STORE_DIR, host.getDataDirectory()); 
 
             this.setTransactionProvider(ArjunaTransactionProvider.getInstance(props));

Modified: trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestDataEntitlements.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestDataEntitlements.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestDataEntitlements.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -16,6 +16,7 @@
     	try {
 			getConnection(VDB, DQP_PROP_FILE, "user=test"); //$NON-NLS-1$
 			TestCase.fail("Should have failed authenticate user test"); //$NON-NLS-1$
+			closeConnection();
 		} catch (Exception e) {
 		}
     }
@@ -23,13 +24,14 @@
     @Test public void testAdminAuth() {
 		try {
 			getConnection(VDB, DQP_PROP_FILE, "user=admin;password=mm"); //$NON-NLS-1$
-			TestCase.fail("Should have failed authenticate user test"); //$NON-NLS-1$
+			TestCase.fail("Should have failed authenticate user test"); //$NON-NLS-1$			
 		} catch (Exception e) {
 		}
 		
 		getConnection(VDB, DQP_PROP_FILE, "user=admin;password=teiid"); //$NON-NLS-1$
 		execute("select * from BQT1.smalla"); //$NON-NLS-1$
 		walkResults();
+		closeConnection();
     }
 
     @Test public void testEntitlements() {
@@ -38,26 +40,29 @@
 			TestCase.fail("Should have failed authenticate user test"); //$NON-NLS-1$
 		} catch (Exception e) {
 		}
-		
+
+		getConnection(VDB, DQP_PROP_FILE, "user=john;password=mm"); //$NON-NLS-1$
 		try {
-			getConnection(VDB, DQP_PROP_FILE, "user=john;password=mm"); //$NON-NLS-1$
 			execute("select intkey, stringkey from BQT1.smalla"); //$NON-NLS-1$
 			walkResults();
 		} catch(Exception e) {
 			TestCase.assertTrue(e.getMessage().endsWith("is not entitled to action <Read> for 1 or more of the groups/elements/procedures.")); //$NON-NLS-1$
 		}
+		closeConnection();
 		
 		getConnection(VDB, DQP_PROP_FILE, "user=paul;password=mm"); //$NON-NLS-1$
 		execute("select intkey, stringkey from BQT1.smalla"); //$NON-NLS-1$
 		assertRowCount(50);
-		
+		closeConnection();
+
+		getConnection(VDB, DQP_PROP_FILE, "user=paul;password=mm"); //$NON-NLS-1$
 		try {
-			getConnection(VDB, DQP_PROP_FILE, "user=paul;password=mm"); //$NON-NLS-1$
 			execute("select * from BQT1.smalla"); //$NON-NLS-1$
 			walkResults();
 		} catch(Exception e) {
 			TestCase.assertTrue(e.getMessage().endsWith("is not entitled to action <Read> for 1 or more of the groups/elements/procedures.")); //$NON-NLS-1$
-		}		
+		}
+		closeConnection();
     }
     
 }

Modified: trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -46,6 +46,7 @@
     			                            "y    2"   //$NON-NLS-1$
 
     	});
+    	closeConnection();
     }    
     
     @Test public void testIntegrationExecution() {
@@ -55,6 +56,7 @@
                 "x    1    1    1    -23    null    -23.0    -23    -23.0    -127    2000-01-02    01:00:00    2000-01-01 00:00:01.0    1    0    -32767    -23    -23    -23", //$NON-NLS-1$
                 "y    2    2    2    -22    -22    null    -22    -22.0    -126    2000-01-03    02:00:00    2000-01-01 00:00:02.0    0    1    -32766    -22    -22    -22", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     /**
@@ -63,6 +65,7 @@
     @Test public void testProcedureExecution() {
     	getConnection(VDB, DQP_PROP_FILE);
     	execute("exec Derby.SQLUDTS(null, null, null, null, null)"); //$NON-NLS-1$
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataTables() throws Exception {
@@ -73,6 +76,7 @@
     			"TABLE_CAT[string]    TABLE_SCHEM[string]    TABLE_NAME[string]    TABLE_TYPE[string]    REMARKS[string]    TYPE_CAT[string]    TYPE_SCHEM[string]    TYPE_NAME[string]    SELF_REFERENCING_COL_NAME[string]    REF_GENERATION[string]    ISPHYSICAL[boolean]", //$NON-NLS-1$
     			"null    VDBLess    SummitData.EXAMPLE    TABLE    null    null    null    null    null    null    true" //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     /**
@@ -88,6 +92,7 @@
     			"null    VDBLess    System.ElementProperties    SYSTEM TABLE    null    null    null    null    null    null    false" //$NON-NLS-1$
 
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataColumns() throws Exception {
@@ -99,6 +104,7 @@
     			"null    VDBLess    SummitData.EXAMPLE    TRADEID    12    string    4000    null    0    0    0    null    null    null    null    0    1    YES    null    null    null    null    NO", //$NON-NLS-1$
     			"null    VDBLess    SummitData.EXAMPLE    NOTIONAL    4    integer    10    null    0    0    0    null    null    null    null    0    2    YES    null    null    null    null    NO", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataColumns1() throws Exception {
@@ -125,6 +131,7 @@
     			"null    VDBLess    Derby.SMALLA    BIGDECIMALVALUE    2    bigdecimal    20    null    0    10    1    null    null    null    null    0    16    NO    null    null    null    null    NO", //$NON-NLS-1$
     			"null    VDBLess    Derby.SMALLA    OBJECTVALUE    12    string    4000    null    0    0    1    null    null    null    null    4096    17    NO    null    null    null    null    NO", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataPrimaryKeys() throws Exception {
@@ -141,6 +148,7 @@
 			   "null    VDBLess    Derby.FLIGHTS    SEGMENT_NUMBER    2    SQL090709161814150", //$NON-NLS-1$
 			   "null    VDBLess    Derby.FLTAVAIL    SEGMENT_NUMBER    2    FLTAVAIL_PK", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataExportedKeys() throws Exception {
@@ -152,6 +160,7 @@
                 "null    VDBLess    Derby.FLIGHTS    FLIGHT_ID    null    VDBLess    Derby.FLTAVAIL    FLIGHT_ID    1    3    3    FLTS_FK    SQL090709161814150    5", //$NON-NLS-1$
     			"null    VDBLess    Derby.FLIGHTS    SEGMENT_NUMBER    null    VDBLess    Derby.FLTAVAIL    SEGMENT_NUMBER    2    3    3    FLTS_FK    SQL090709161814150    5" //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataImportedKeys() throws Exception {
@@ -169,6 +178,7 @@
                 "null    VDBLess    Derby.SMALLA    INTKEY    null    VDBLess    Derby.SMALLBRIDGE    AKEY    1    3    3    SMLA_FK    SQL060110103634070    5", //$NON-NLS-1$
                 "null    VDBLess    Derby.SMALLB    INTKEY    null    VDBLess    Derby.SMALLBRIDGE    BKEY    1    3    3    SMLB_FK    SQL060110103635170    5", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataIndexInfo() throws Exception {
@@ -195,6 +205,7 @@
 				"null    VDBLess    Derby.SYSTRIGGERS    false    null    SYSTRIGGERS_INDEX3    0    1    TABLEID    null    0    1    null", //$NON-NLS-1$
 				"null    VDBLess    Derby.SYSTRIGGERS    false    null    SYSTRIGGERS_INDEX3    0    2    CREATIONTIMESTAMP    null    0    1    null", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataProcedures() throws Exception {
@@ -207,6 +218,7 @@
     			"null    VDBLess    Derby.REMOVE_JAR    null    null    null    null    1    Derby.REMOVE_JAR", //$NON-NLS-1$
     			"null    VDBLess    Derby.REPLACE_JAR    null    null    null    null    1    Derby.REPLACE_JAR", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
     
     @Test public void testDatabaseMetaDataProcedureColumns() throws Exception {
@@ -221,6 +233,7 @@
     			"null    VDBLess    Derby.SQLUDTS    UDTTYPES    1    12    string    128    256    0    0    1    null    null    null    null    null    4    YES    Derby.SQLUDTS.UDTTYPES", //$NON-NLS-1$
     			"null    VDBLess    Derby.SQLUDTS    OPTIONS    1    12    string    4000    8000    0    0    1    null    null    null    null    null    5    YES    Derby.SQLUDTS.OPTIONS", //$NON-NLS-1$
     	});
+    	closeConnection();
     }
         
 }

Modified: trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestPartsDatabaseMetadata.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestPartsDatabaseMetadata.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestPartsDatabaseMetadata.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -29,6 +29,7 @@
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -56,6 +57,10 @@
     	getConnection(VDB, DQP_PROP_FILE);
     	dbMetadata = this.internalConnection.getMetaData();
     }
+    
+    @After public void tearDown() {
+    	closeConnection();
+    }
         
     private void checkResult(String testName, ResultSet actualResults)  throws Exception {
     	ResultSetMetaData resultMetadata = actualResults.getMetaData();

Modified: trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestResultSetMetadata.java
===================================================================
--- trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestResultSetMetadata.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/java/com/metamatrix/systemmodel/TestResultSetMetadata.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -22,6 +22,7 @@
 
 package com.metamatrix.systemmodel;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -43,6 +44,10 @@
     	getConnection(VDB, DQP_PROP_FILE);
     }
     
+    @After public void tearDown() {
+    	closeConnection();
+    }
+    
     private void executeTest(String sql, String[] expected) throws Exception {
     	execute(sql);
     	java.sql.ResultSet rs = this.internalResultSet;

Modified: trunk/test-integration/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataInConnector.java
===================================================================
--- trunk/test-integration/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataInConnector.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/java/org/teiid/connector/metadata/runtime/TestMetadataInConnector.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -16,13 +16,15 @@
     	execute("Select * from TableA"); //$NON-NLS-1$
     	String expected[] = {"column1[string]    column2[integer]"}; //$NON-NLS-1$
     	assertResults(expected); 
+    	closeConnection();
     }
     
     @Test public void testMetadataProcedure() throws Exception {
     	getConnection(VDB, DQP_PROP_FILE, ""); //$NON-NLS-1$
     	execute("exec AnyModel.ProcedureB(?)", new Object[] {"foo"}); //$NON-NLS-1$ //$NON-NLS-2$
     	String expected[] = {"column1[string]    column2[integer]"}; //$NON-NLS-1$
-    	assertResults(expected); 
+    	assertResults(expected);
+    	closeConnection();
     }	
     
 }

Modified: trunk/test-integration/src/test/resources/3473/3473.properties
===================================================================
--- trunk/test-integration/src/test/resources/3473/3473.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/3473/3473.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -28,7 +28,7 @@
 dqp.logLevel=2
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 

Modified: trunk/test-integration/src/test/resources/authcheck/bqt.properties
===================================================================
--- trunk/test-integration/src/test/resources/authcheck/bqt.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/authcheck/bqt.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -24,7 +24,7 @@
 vdb.definition=./bqt.def
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 membership.enabled=true
 membership.superUser=admin

Modified: trunk/test-integration/src/test/resources/bqt/bqt.properties
===================================================================
--- trunk/test-integration/src/test/resources/bqt/bqt.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/bqt/bqt.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -24,7 +24,7 @@
 vdb.definition=./loopback.DEF
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 

Modified: trunk/test-integration/src/test/resources/dqp/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/dqp/dqp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/dqp/dqp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -29,7 +29,7 @@
 #dqp.classpath=./lib/;./license/;./lib/metamatrix-dqp.jar;./lib/bcprov-jdk14-122.jar;./extensions/MJjdbc.jar
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 

Modified: trunk/test-integration/src/test/resources/metadata/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/metadata/dqp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/metadata/dqp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -26,7 +26,7 @@
 vdb.definition=./ConfigurationInfo.def
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/test-integration/src/test/resources/partssupplier/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/partssupplier/dqp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/partssupplier/dqp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -30,7 +30,7 @@
 dqp.buffer.usedisk=false
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/test-integration/src/test/resources/vdbless/dqp.properties
===================================================================
--- trunk/test-integration/src/test/resources/vdbless/dqp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/vdbless/dqp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -25,7 +25,7 @@
 vdb.definition=./ConfigurationInfo.def
 processorDebugAllowed=true
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 teiid.home=target/scratch
 

Modified: trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties
===================================================================
--- trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/xml-vp/xmlvp.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -30,7 +30,7 @@
 dqp.buffer.usedisk=false
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 teiid.home=target/scratch
 

Modified: trunk/test-integration/src/test/resources/xquery/xquery.properties
===================================================================
--- trunk/test-integration/src/test/resources/xquery/xquery.properties	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/test-integration/src/test/resources/xquery/xquery.properties	2009-07-17 17:57:05 UTC (rev 1148)
@@ -4,7 +4,7 @@
 dqp.logLevel=2
 
 #only for testing, as this takes more time to start and shutdown
-metamatrix.xatxnmgr.enable_recovery=false
+xa.enable_recovery=false
 
 
 teiid.home=target/scratch

Modified: trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java
===================================================================
--- trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/txn-jbossts/src/main/java/com/metamatrix/xa/arjuna/ArjunaTransactionProvider.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -77,8 +77,8 @@
      */
     public void init(Properties props) throws XATransactionException {
         // unique name for this txn manager
-        String vmName = props.getProperty(TransactionService.VMNAME);        
-        String txnMgrUniqueName = "txnmgr_" + props.getProperty(TransactionService.HOSTNAME, "").replace('.', '_') + "_" + vmName; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        String vmName = props.getProperty(TransactionService.PROCESSNAME);        
+        String txnMgrUniqueName = "txnmgr_" + "_" + vmName; //$NON-NLS-1$ //$NON-NLS-2$
 
         // set the directory for storing the in-flight transactions
         String baseDir = props.getProperty(TransactionService.TXN_STORE_DIR, System.getProperty("java.io.tmpdir")); //$NON-NLS-1$

Modified: trunk/txn-jbossts/src/test/java/com/metamatrix/xa/arjuna/TestArjunaRecovery.java
===================================================================
--- trunk/txn-jbossts/src/test/java/com/metamatrix/xa/arjuna/TestArjunaRecovery.java	2009-07-17 15:39:12 UTC (rev 1147)
+++ trunk/txn-jbossts/src/test/java/com/metamatrix/xa/arjuna/TestArjunaRecovery.java	2009-07-17 17:57:05 UTC (rev 1148)
@@ -81,8 +81,7 @@
         final List done = new ArrayList();
         
         Properties props = new Properties();
-        props.setProperty(TransactionService.VMNAME, "test"); //$NON-NLS-1$
-        props.setProperty(TransactionService.HOSTNAME, "test"); //$NON-NLS-1$
+        props.setProperty(TransactionService.PROCESSNAME, "test"); //$NON-NLS-1$
         RecoveryConfiguration.setRecoveryManagerPropertiesFile("com/metamatrix/xa/arjuna/jbossjta-properties.xml"); //$NON-NLS-1$
         com.arjuna.ats.jta.common.Configuration.setPropertiesFile("com/metamatrix/xa/arjuna/jbossjta-properties.xml"); //$NON-NLS-1$
         Configuration.setPropertiesFile("com/metamatrix/xa/arjuna/jbossjta-properties.xml"); //$NON-NLS-1$



More information about the teiid-commits mailing list