[teiid-commits] teiid SVN: r2886 - in branches/7.3.x: build/kits/jboss-container/deploy/teiid and 13 other directories.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Mon Jan 31 10:36:31 EST 2011
Author: shawkins
Date: 2011-01-31 10:36:30 -0500 (Mon, 31 Jan 2011)
New Revision: 2886
Added:
branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java
branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java
Removed:
branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java
branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java
Modified:
branches/7.3.x/build/kits/jboss-container/COPYRIGHT.txt
branches/7.3.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
branches/7.3.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java
branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
branches/7.3.x/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
branches/7.3.x/engine/src/main/java/org/teiid/cache/Cache.java
branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheFactory.java
branches/7.3.x/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java
branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
branches/7.3.x/engine/src/main/java/org/teiid/query/sql/symbol/Reference.java
branches/7.3.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
branches/7.3.x/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java
branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
branches/7.3.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
branches/7.3.x/test-integration/db/src/main/java/org/teiid/test/util/TestResultSetUtil.java
Log:
forward merge from 7.1.1 and an update to the releasenotes
Modified: branches/7.3.x/build/kits/jboss-container/COPYRIGHT.txt
===================================================================
--- branches/7.3.x/build/kits/jboss-container/COPYRIGHT.txt 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/build/kits/jboss-container/COPYRIGHT.txt 2011-01-31 15:36:30 UTC (rev 2886)
@@ -1,4 +1,4 @@
-Portions Copyright (C) 2008-2009 Red Hat, Inc.
+Portions Copyright (C) 2008-2011 Red Hat, Inc.
Portions Copyright (C) 2000-2007 MetaMatrix, Inc.
Portions Copyright (c) 2000, 2003, 2008 IBM Corporation and others.
Portions Copyright (c) 1997-2000 Sun Microsystems, Inc.
\ No newline at end of file
Modified: branches/7.3.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- branches/7.3.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/build/kits/jboss-container/deploy/teiid/teiid-jboss-beans.xml 2011-01-31 15:36:30 UTC (rev 2886)
@@ -66,7 +66,8 @@
<!-- Allowed values are LRU, EXPIRATION.
Setting this value to LRU will cause cache hint TTL values
to be ignored. (default EXPIRATION) -->
- <property name="type">EXPIRATION</property>
+ <property name="type">EXPIRATION</property>
+ <property name="location">resultset</property>
</bean>
<bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">
Modified: branches/7.3.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.3.x/build/kits/jboss-container/teiid-releasenotes.html 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/build/kits/jboss-container/teiid-releasenotes.html 2011-01-31 15:36:30 UTC (rev 2886)
@@ -10,7 +10,7 @@
<P><A HREF="http://www.teiid.org/"><IMG SRC="https://www.jboss.org/dms/teiid/images/teiid-banner.png" NAME="graphics1" ALT="Teiid" ALIGN=BOTTOM WIDTH=800></A>
<H1>Teiid ${project.version} Release Notes</H1>
-<P>Teiid ${project.version} adds performance and integration features.
+<P>Teiid ${project.version} adds updatable view, performance, and integration features.
<H2>Overview</H2>
<UL>
@@ -175,7 +175,147 @@
<h2><a name="Details">Detailed Release Notes</a></h2>
Detailed Release Notes - Teiid - Version ${project.version}
-
+
+<h2> Bug
+</h2>
+<ul>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-89'>TEIID-89</a>] - Data roles should account for the ability to create temp tables
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1350'>TEIID-1350</a>] - Teiid 7.2 in JBoss EAP cluster (with clustered cache on) will not deploy VDBs
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1357'>TEIID-1357</a>] - Provide an example of an ODBC ds file to be used with a JDBC-ODBC bridge connection
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1360'>TEIID-1360</a>] - with clause not processed in views
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1361'>TEIID-1361</a>] - Salesforce IN predicate handling
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1362'>TEIID-1362</a>] - salesforce push down queries won't get resolved correctly
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1370'>TEIID-1370</a>] - Error Code:107 Message:'The column prefix 'custsale' does not match with a table name or alias name used in the query - But query is valid
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1372'>TEIID-1372</a>] - Change the default Teiid user from "admin" to something else
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1373'>TEIID-1373</a>] - Document that 'OID' column in the system tables is not durable across different versions of the same VDB.
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1381'>TEIID-1381</a>] - pushdown validation not accurate for all update
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1387'>TEIID-1387</a>] - Restrict access of default port 31000 to JDBC and 31443 to Admin connections
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1390'>TEIID-1390</a>] - Partial multi-byte char values misread in InputStreamReader
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1391'>TEIID-1391</a>] - Changes to the use of SSL when connecting with the Teiid Driver are ignored after a successful connection
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1395'>TEIID-1395</a>] - XMLPARSE error message references XMLSERIALIZE
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1396'>TEIID-1396</a>] - XML_PLAN output to server log too verbose for DEBUG level logging
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1399'>TEIID-1399</a>] - Adding ORDER BY to SELECT COUNT(*) FROM ... returns org.teiid.core.TeiidProcessingException: null to client - Needs clearer message
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1401'>TEIID-1401</a>] - QueryRewriter issue with certain UDFs
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1402'>TEIID-1402</a>] - SELECTing data from salesforce with a WHERE condition which includes ID results in a NPE
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1404'>TEIID-1404</a>] - The teiid runtime jar overrides commons logging configuration
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1406'>TEIID-1406</a>] - Salesforce connector does not parse {ts'2003-03-11 11:42:10.5'} - gets mismatched character ' ' expecting ':'
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1407'>TEIID-1407</a>] - Client code fails while inserting "lobs" in few situations
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1408'>TEIID-1408</a>] - SalesForce.com - Unable to get managed connection - java.lang.NullPointerException
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1410'>TEIID-1410</a>] - MALFORMED Query when trying to execute a query with OUTER JOINs which only contains elements from JOINed source
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1411'>TEIID-1411</a>] - Incorrect IN behavior when using a SELECT clause as IN values
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1414'>TEIID-1414</a>] - Execution of a Prepared Statement may receive LanguageBridgeFactory AssertionError
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1416'>TEIID-1416</a>] - Admin console shows no information about sessions
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1418'>TEIID-1418</a>] - Metadata loaded incorrectly
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1420'>TEIID-1420</a>] - Adminshell getTransactions() fails - exception = org.teiid.adminapi.AdminComponentException:
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1422'>TEIID-1422</a>] - Limit pushing can result in inconsistent xml results
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1426'>TEIID-1426</a>] - NPE when SELECTing NULL columns from JOINed tables
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1427'>TEIID-1427</a>] - Class not found in Teiid JON agent
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1428'>TEIID-1428</a>] - ODBC connection fails if the TeiidDriver is not registered.
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1434'>TEIID-1434</a>] - Example dynamicvdb-portfolio customer-schema.sql INSERT INTO HOLDINGS has PRODUCT_ID references that don't exist in PRODUCT table causing sql to fail
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1435'>TEIID-1435</a>] - SQL type boolean imported as object for dynamic vdbs
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1439'>TEIID-1439</a>] - Adminshell/API - sequence of datasource creation/VDB deployment and queries results in deployment error
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1441'>TEIID-1441</a>] - java.lang.NullPointerException - on queries involving lookup (temp table cache does not have buffermanager set on it)
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1442'>TEIID-1442</a>] - clearCache("QUERY_SERVICE_RESULT_SET_CACHE") - in ER7 - totalEntries is not reset to zero
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1443'>TEIID-1443</a>] - SalesForce connector execution of procedure fails with NPE
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1444'>TEIID-1444</a>] - Jopr Plugin has description for refreshing Materialized Views that's awkward: "Refresh a given any Materialized View for this VDB"
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1445'>TEIID-1445</a>] - ConcurrentModificationException during the startup of the Server
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1446'>TEIID-1446</a>] - Error during startup when CXF is installed
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1451'>TEIID-1451</a>] - Teiid does not handle failover correctly
+</li>
+</ul>
+
+<h2> Feature Request
+</h2>
+<ul>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-146'>TEIID-146</a>] - Translate Criteria enhancement
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-192'>TEIID-192</a>] - Add the ability to switch the identity on connections
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-211'>TEIID-211</a>] - subquery optimization
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-229'>TEIID-229</a>] - Support update of the view column using a column
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-231'>TEIID-231</a>] - Ability to support Connector Level UDF functions in the System
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1227'>TEIID-1227</a>] - Lob values should be cachable
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1253'>TEIID-1253</a>] - Allow for cache scope to be set in the cache hint
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1267'>TEIID-1267</a>] - Add support for non-pushdown subquery evaluation on update statements
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1330'>TEIID-1330</a>] - API request: Delegating Translator
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1338'>TEIID-1338</a>] - Add transitive join conditions across sources
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1349'>TEIID-1349</a>] - Better default update procedure handling
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1351'>TEIID-1351</a>] - Replace translate criteria
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1376'>TEIID-1376</a>] - Add support for pushing joins through a union
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1385'>TEIID-1385</a>] - Add a way to support escaped strings
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1389'>TEIID-1389</a>] - Add additional detection for conflicting criteria to help optimize query plan
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1412'>TEIID-1412</a>] - Teiid should take care of salesforce query limits by itself
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1421'>TEIID-1421</a>] - Support better scrolling of cached results
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1433'>TEIID-1433</a>] - Temp tables should support count(*)
+</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1440'>TEIID-1440</a>] - Add support for not null and auto increment for temp table columns
+</li>
+</ul>
+
+<h2> Quality Risk
+</h2>
+<ul>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1368'>TEIID-1368</a>] - "Each" should be a parser keyword
+</li>
+</ul>
+
+
<h2><a name="Documentation">Documentation and Help</a></h2>
The <a href="http://www.jboss.org/teiid/">Teiid community project</a> is hosted on jboss.org.
Modified: branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java
===================================================================
--- branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/ClusterableCacheFactory.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -31,7 +31,6 @@
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
import org.teiid.cache.DefaultCacheFactory;
-import org.teiid.cache.Cache.Type;
import org.teiid.core.TeiidRuntimeException;
public class ClusterableCacheFactory implements CacheFactory, Serializable {
@@ -42,7 +41,7 @@
private String cacheManagerName;
@Override
- public <K, V> Cache<K, V> get(Type type, CacheConfiguration config) {
+ public <K, V> Cache<K, V> get(String location, CacheConfiguration config) {
if (this.delegate == null) {
Object cacheManager = getClusteredCache();
if (cacheManager == null) {
@@ -56,7 +55,7 @@
}
}
}
- return delegate.get(type, config);
+ return delegate.get(location, config);
}
public void setResultsetCacheName(String name) {
Modified: branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/cache-jbosscache/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -36,7 +36,6 @@
import org.teiid.cache.Cache;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
-import org.teiid.cache.Cache.Type;
import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.core.TeiidRuntimeException;
@@ -55,7 +54,7 @@
/**
* {@inheritDoc}
*/
- public Cache get(Type type, CacheConfiguration config) {
+ public Cache get(String location, CacheConfiguration config) {
if (!destroyed) {
if (!this.cacheStore.getCacheStatus().allowInvocations()) {
@@ -63,7 +62,7 @@
}
Node cacheRoot = this.cacheStore.getRoot().addChild(Fqn.fromString("Teiid")); //$NON-NLS-1$
- Node node = cacheRoot.addChild(Fqn.fromString(type.location()));
+ Node node = cacheRoot.addChild(Fqn.fromString(location));
node.setResident(true);
Region cacheRegion = this.cacheStore.getRegion(node.getFqn(), true);
Modified: branches/7.3.x/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- branches/7.3.x/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -214,7 +214,7 @@
this.errors = errors;
}
- public List<ValidationError> getValidationErrors(ValidationError.Severity severity){
+ public synchronized List<ValidationError> getValidationErrors(ValidationError.Severity severity){
if (this.errors == null) {
return Collections.emptyList();
}
@@ -227,7 +227,7 @@
return list;
}
- public ValidationError addError(String severity, String message) {
+ public synchronized ValidationError addError(String severity, String message) {
if (this.errors == null) {
this.errors = new ArrayList<ValidationError>();
}
@@ -236,14 +236,14 @@
return ve;
}
- public boolean removeError(ValidationError remove) {
+ public synchronized boolean removeError(ValidationError remove) {
if (this.errors == null) {
return false;
}
return this.errors.remove(remove);
}
- public void clearErrors() {
+ public synchronized void clearErrors() {
this.errors.clear();
}
Deleted: branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java
===================================================================
--- branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package org.teiid.translator.salesforce.execution;
-
-import static org.junit.Assert.*;
-
-import java.math.BigDecimal;
-import java.util.Arrays;
-
-import javax.xml.datatype.XMLGregorianCalendar;
-
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.teiid.cdk.api.TranslationUtility;
-import org.teiid.language.Call;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.salesforce.SalesforceConnection;
-import org.teiid.translator.salesforce.execution.visitors.TestVisitors;
-
- at SuppressWarnings("nls")
-public class TestProcedureExecution {
-
- private static TranslationUtility translationUtility = new TranslationUtility(TestVisitors.exampleSalesforce());
-
- @Test public void testProcedureName() throws Exception {
- Call command = (Call)translationUtility.parseCommand("exec getupdated('foo', {d '1970-01-01'}, {d '1990-01-01'})"); //$NON-NLS-1$
- SalesforceConnection sfc = Mockito.mock(SalesforceConnection.class);
- UpdatedResult ur = new UpdatedResult();
- ur.setIDs(Arrays.asList("1", "2"));
- Mockito.stub(sfc.getUpdated(Mockito.eq("foo"), (XMLGregorianCalendar)Mockito.anyObject(), (XMLGregorianCalendar)Mockito.anyObject())).toReturn(ur);
- ProcedureExecutionParentImpl pepi = new ProcedureExecutionParentImpl(command, sfc, Mockito.mock(RuntimeMetadata.class), Mockito.mock(ExecutionContext.class));
- pepi.execute();
- assertNotNull(pepi.next());
- assertNotNull(pepi.next());
- assertNull(pepi.next());
- pepi.close();
- }
-
-}
Copied: branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java (from rev 2885, branches/7.1.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java)
===================================================================
--- branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java (rev 0)
+++ branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/TestProcedureExecution.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.salesforce.execution;
+
+import static org.junit.Assert.*;
+
+import java.util.Arrays;
+
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.cdk.api.TranslationUtility;
+import org.teiid.language.Call;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.salesforce.SalesforceConnection;
+import org.teiid.translator.salesforce.execution.visitors.TestVisitors;
+
+ at SuppressWarnings("nls")
+public class TestProcedureExecution {
+
+ private static TranslationUtility translationUtility = new TranslationUtility(TestVisitors.exampleSalesforce());
+
+ @Test public void testProcedureName() throws Exception {
+ Call command = (Call)translationUtility.parseCommand("exec getupdated('foo', {d '1970-01-01'}, {d '1990-01-01'})"); //$NON-NLS-1$
+ SalesforceConnection sfc = Mockito.mock(SalesforceConnection.class);
+ UpdatedResult ur = new UpdatedResult();
+ ur.setIDs(Arrays.asList("1", "2"));
+ Mockito.stub(sfc.getUpdated(Mockito.eq("foo"), (XMLGregorianCalendar)Mockito.anyObject(), (XMLGregorianCalendar)Mockito.anyObject())).toReturn(ur);
+ ProcedureExecutionParentImpl pepi = new ProcedureExecutionParentImpl(command, sfc, Mockito.mock(RuntimeMetadata.class), Mockito.mock(ExecutionContext.class));
+ pepi.execute();
+ assertNotNull(pepi.next());
+ assertNotNull(pepi.next());
+ assertNull(pepi.next());
+ pepi.close();
+ }
+
+}
Modified: branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
===================================================================
--- branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -106,6 +106,7 @@
Column obj = contactCols.get(i);
obj.setNameInSource(contactNameInSource[i]);
}
+
List<ProcedureParameter> params = new LinkedList<ProcedureParameter>();
params.add(RealMetadataFactory.createParameter("type", SPParameter.IN, TypeFacility.RUNTIME_NAMES.STRING));
params.add(RealMetadataFactory.createParameter("start", SPParameter.IN, TypeFacility.RUNTIME_NAMES.TIMESTAMP));
Modified: branches/7.3.x/engine/src/main/java/org/teiid/cache/Cache.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/cache/Cache.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/cache/Cache.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -28,29 +28,7 @@
* Abstraction over cache providers
*/
public interface Cache<K, V> {
-
- public enum Type {
- MATTABLES("MatTables"), //$NON-NLS-1$
- MATTABLEUPDATES("MatTableUpdates"), //$NON-NLS-1$
- RESULTSET("ResultSet"), //$NON-NLS-1$
- RESULTSET_BATCHES(RESULTSET, "batches"), //$NON-NLS-1$
- PREPAREDPLAN("PreparaedPlan"); //$NON-NLS-1$
- private String location;
-
- Type(String location){
- this.location = location;
- }
-
- Type(Type base, String location){
- this.location = base.location+"/"+location; //$NON-NLS-1$
- }
-
- public String location() {
- return this.location;
- }
- }
-
/**
* Retrieves the value for the given Key
*
Modified: branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheConfiguration.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheConfiguration.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -30,9 +30,7 @@
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class CacheConfiguration {
-
- public static CacheConfiguration DEFAULT = new CacheConfiguration(Policy.LRU, 60*60, 100); // 1 hours with 100 nodes.
-
+
public enum Policy {
LRU, // Least Recently Used
EXPIRATION
@@ -43,14 +41,16 @@
private int maxEntries;
private boolean enabled = true;
private String name;
-
+ private String location;
+
public CacheConfiguration() {
}
- public CacheConfiguration(Policy policy, int maxAgeInSeconds, int maxNodes) {
+ public CacheConfiguration(Policy policy, int maxAgeInSeconds, int maxNodes, String location) {
this.policy = policy;
this.maxage = maxAgeInSeconds;
this.maxEntries = maxNodes;
+ this.location = location;
}
public Policy getPolicy() {
@@ -89,6 +89,15 @@
this.name = name;
}
+ @ManagementProperty(description="location prefix in cache", readOnly=true)
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
@Override
public int hashCode() {
final int prime = 31;
Modified: branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheFactory.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheFactory.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/cache/CacheFactory.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -30,7 +30,7 @@
* @param config configuration setup for the cache
* @return
*/
- <K,V> Cache<K, V> get(Cache.Type type, CacheConfiguration config);
+ <K,V> Cache<K, V> get(String location, CacheConfiguration config);
/**
* Destroy the cache factory and any caches underneath.
Modified: branches/7.3.x/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/cache/DefaultCacheFactory.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -23,18 +23,19 @@
import java.io.Serializable;
-import org.teiid.cache.Cache.Type;
+import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.core.TeiidRuntimeException;
public class DefaultCacheFactory implements CacheFactory, Serializable {
private static final long serialVersionUID = -5541424157695857527L;
+ private static CacheConfiguration DEFAULT = new CacheConfiguration(Policy.LRU, 60*60, 100, "default"); // 1 hours with 100 nodes. //$NON-NLS-1$
DefaultCache cacheRoot;
private volatile boolean destroyed = false;
public DefaultCacheFactory() {
- this(CacheConfiguration.DEFAULT);
+ this(DEFAULT);
}
public DefaultCacheFactory(CacheConfiguration config) {
@@ -47,9 +48,9 @@
}
@Override
- public <K, V> Cache<K, V> get(Type type, CacheConfiguration config) {
+ public <K, V> Cache<K, V> get(String location, CacheConfiguration config) {
if (!destroyed) {
- return cacheRoot.addChild(type.location());
+ return cacheRoot.addChild(location);
}
throw new TeiidRuntimeException("Cache system has been shutdown"); //$NON-NLS-1$
}
Modified: branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -44,7 +44,6 @@
import org.teiid.adminapi.impl.CacheStatisticsMetadata;
import org.teiid.adminapi.impl.RequestMetadata;
import org.teiid.adminapi.impl.WorkerPoolStatisticsMetadata;
-import org.teiid.cache.Cache;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
import org.teiid.cache.CacheConfiguration.Policy;
@@ -683,24 +682,23 @@
//result set cache
CacheConfiguration rsCacheConfig = config.getResultsetCacheConfig();
if (rsCacheConfig != null && rsCacheConfig.isEnabled()) {
- this.rsCache = new SessionAwareCache<CachedResults>(this.cacheFactory, Cache.Type.RESULTSET, rsCacheConfig);
+ this.rsCache = new SessionAwareCache<CachedResults>(this.cacheFactory, SessionAwareCache.Type.RESULTSET, rsCacheConfig);
this.rsCache.setBufferManager(this.bufferManager);
}
//prepared plan cache
- prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, Cache.Type.PREPAREDPLAN, new CacheConfiguration(Policy.LRU, 60*60*8, config.getPreparedPlanCacheMaxCount()));
+ prepPlanCache = new SessionAwareCache<PreparedPlan>(this.cacheFactory, SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration(Policy.LRU, 60*60*8, config.getPreparedPlanCacheMaxCount(), "PreparedCache")); //$NON-NLS-1$
prepPlanCache.setBufferManager(this.bufferManager);
this.processWorkerPool = new ThreadReuseExecutor(DQPConfiguration.PROCESS_PLAN_QUEUE_NAME, config.getMaxThreads());
if (cacheFactory.isReplicated()) {
- matTables = new SessionAwareCache<CachedResults>(this.cacheFactory, Cache.Type.RESULTSET, new CacheConfiguration(Policy.LRU, -1, -1));
+ matTables = new SessionAwareCache<CachedResults>(this.cacheFactory, SessionAwareCache.Type.RESULTSET, new CacheConfiguration(Policy.LRU, -1, -1, "MaterilizationTables")); //$NON-NLS-1$
matTables.setBufferManager(this.bufferManager);
}
- dataTierMgr = new TempTableDataManager(new DataTierManagerImpl(this,
- this.bufferService), this.bufferManager, this.processWorkerPool, this.rsCache, matTables, this.cacheFactory);
+ dataTierMgr = new TempTableDataManager(new DataTierManagerImpl(this,this.bufferService), this.bufferManager, this.processWorkerPool, this.rsCache, this.matTables, this.cacheFactory);
}
public void setBufferService(BufferService service) {
Modified: branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -51,6 +51,10 @@
*/
public class SessionAwareCache<T> {
public static final int DEFAULT_MAX_SIZE_TOTAL = 512;
+ public enum Type {
+ RESULTSET,
+ PREPAREDPLAN;
+ }
private Cache<CacheID, T> localCache;
private Cache<CacheID, T> distributedCache;
@@ -68,23 +72,24 @@
}
SessionAwareCache(int maxSize){
- this(new DefaultCacheFactory(), Cache.Type.RESULTSET, new CacheConfiguration(Policy.LRU, 60, maxSize));
+ this(new DefaultCacheFactory(), Type.RESULTSET, new CacheConfiguration(Policy.LRU, 60, maxSize, "default")); //$NON-NLS-1$
}
- SessionAwareCache (final CacheFactory cacheFactory, final Cache.Type type, final CacheConfiguration config){
+ SessionAwareCache (final CacheFactory cacheFactory, final Type type, final CacheConfiguration config){
this.maxSize = config.getMaxEntries();
if(this.maxSize < 0){
this.maxSize = Integer.MAX_VALUE;
}
this.localCache = new DefaultCache<CacheID, T>("local", maxSize, config.getMaxAgeInSeconds()*1000); //$NON-NLS-1$
- if (type == Cache.Type.PREPAREDPLAN) {
+ if (type == Type.PREPAREDPLAN) {
this.distributedCache = localCache;
}
else {
- this.distributedCache = cacheFactory.get(type, config);
- if (type == Cache.Type.RESULTSET) {
- this.tupleBatchCache = cacheFactory.get(Cache.Type.RESULTSET_BATCHES, config);
+ String location = config.getLocation()+"/"+type.name(); //$NON-NLS-1$
+ this.distributedCache = cacheFactory.get(location, config);
+ if (type == Type.RESULTSET) {
+ this.tupleBatchCache = cacheFactory.get(location+"/batches", config); //$NON-NLS-1$
}
else {
this.tupleBatchCache = this.distributedCache;
Modified: branches/7.3.x/engine/src/main/java/org/teiid/query/sql/symbol/Reference.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/query/sql/symbol/Reference.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/query/sql/symbol/Reference.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -179,10 +179,11 @@
return false;
}
//metadata hack
- if (!(this.expression.getMetadataID() instanceof TempMetadataID)) {
+ if (this.expression.getGroupSymbol() == null || !(this.expression.getGroupSymbol().getMetadataID() instanceof TempMetadataID)) {
return true;
}
- TempMetadataID tid = (TempMetadataID)this.expression.getMetadataID();
+
+ TempMetadataID tid = (TempMetadataID)this.expression.getGroupSymbol().getMetadataID();
return !tid.isScalarGroup();
}
Modified: branches/7.3.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- branches/7.3.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -153,8 +153,8 @@
this.cache = cache;
this.distributedCache = distibutedCache;
if (distibutedCache != null) {
- CacheConfiguration cc = new CacheConfiguration(Policy.LRU, -1, -1);
- tables = cacheFactory.get(Cache.Type.MATTABLES, cc);
+ CacheConfiguration cc = new CacheConfiguration(Policy.LRU, -1, -1, "MaterializationUpdates"); //$NON-NLS-1$
+ tables = cacheFactory.get(cc.getLocation(), cc);
}
}
Modified: branches/7.3.x/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- branches/7.3.x/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -2675,7 +2675,8 @@
StringBuffer procedure = new StringBuffer("CREATE VIRTUAL PROCEDURE \n"); //$NON-NLS-1$
procedure.append("BEGIN\n"); //$NON-NLS-1$
procedure.append("create local temporary table x (y string);\n"); //$NON-NLS-1$
- procedure.append("update x set y = in1 || 'foo';\n"); //$NON-NLS-1$
+ procedure.append("declare string s = 'foo';\n"); //$NON-NLS-1$
+ procedure.append("update x set y = in1 || s;\n"); //$NON-NLS-1$
procedure.append("update pm1.g1 set e1 = lookup('pm1.g1', 'e1', 'e2', in1);\n"); //$NON-NLS-1$
procedure.append("exec pm1.sq2(in1 || 'foo');\n"); //$NON-NLS-1$
procedure.append("END"); //$NON-NLS-1$
Modified: branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -150,21 +150,23 @@
} catch (IOException e1) {
LogManager.logWarning(LogConstants.CTX_RUNTIME, e1, RuntimePlugin.Util.getString("vdb_save_failed", deployment.getName()+"."+deployment.getVersion())); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ boolean valid = true;
+ synchronized (deployment) {
+ if (!preview) {
+ valid = validateSources(cmr, deployment);
- boolean valid = true;
- if (!preview) {
- valid = validateSources(cmr, deployment);
-
- // Check if the VDB is fully configured.
- if (valid) {
+ // Check if the VDB is fully configured.
+ if (valid) {
+ deployment.setStatus(VDB.Status.ACTIVE);
+ } else {
+ deployment.setStatus(VDB.Status.INACTIVE);
+ }
+ }
+ else {
deployment.setStatus(VDB.Status.ACTIVE);
- } else {
- deployment.setStatus(VDB.Status.INACTIVE);
- }
+ }
}
- else {
- deployment.setStatus(VDB.Status.ACTIVE);
- }
LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_deployed",deployment, valid?"active":"inactive")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -341,7 +343,7 @@
}
}
- synchronized (this) {
+ synchronized (vdb) {
if (!loaded) {
vdb.setStatus(VDB.Status.INACTIVE);
String msg = RuntimePlugin.Util.getString("failed_to_retrive_metadata", vdb.getName()+"-"+vdb.getVersion(), model.getName()); //$NON-NLS-1$ //$NON-NLS-2$
Modified: branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -67,39 +67,41 @@
if (vdb.getStatus() == VDB.Status.ACTIVE || vdb.isPreview()) {
continue;
}
- ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
-
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
- if (model.getErrors().isEmpty()) {
- continue;
+ synchronized (vdb) {
+ ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
+
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+ if (model.getErrors().isEmpty()) {
+ continue;
+ }
+
+ String sourceName = getSourceName(resourceName, model, translator);
+ if (sourceName != null) {
+ ConnectorManager cm = cmr.getConnectorManager(sourceName);
+ model.clearErrors();
+ String status = cm.getStausMessage();
+ if (status != null && status.length() > 0) {
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), status);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, status);
+ }
+ }
}
-
- String sourceName = getSourceName(resourceName, model, translator);
- if (sourceName != null) {
- ConnectorManager cm = cmr.getConnectorManager(sourceName);
- model.clearErrors();
- String status = cm.getStausMessage();
- if (status != null && status.length() > 0) {
- model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), status);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, status);
- }
+
+ boolean valid = true;
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+ if (!model.getErrors().isEmpty()) {
+ valid = false;
+ break;
+ }
}
- }
-
- boolean valid = true;
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
- if (!model.getErrors().isEmpty()) {
- valid = false;
- break;
+
+ if (valid) {
+ vdb.setStatus(VDB.Status.ACTIVE);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
}
}
-
- if (valid) {
- vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
- }
}
}
@@ -108,25 +110,26 @@
if (vdb.isPreview()) {
continue;
}
-
- for (Model m:vdb.getModels()) {
- ModelMetaData model = (ModelMetaData)m;
-
- String sourceName = getSourceName(resourceName, model, translator);
- if (sourceName != null) {
- vdb.setStatus(VDB.Status.INACTIVE);
- String msg = null;
- if (translator) {
- msg = RuntimePlugin.Util.getString("translator_not_found", vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName)); //$NON-NLS-1$
+ synchronized (vdb) {
+ for (Model m:vdb.getModels()) {
+ ModelMetaData model = (ModelMetaData)m;
+
+ String sourceName = getSourceName(resourceName, model, translator);
+ if (sourceName != null) {
+ vdb.setStatus(VDB.Status.INACTIVE);
+ String msg = null;
+ if (translator) {
+ msg = RuntimePlugin.Util.getString("translator_not_found", vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName)); //$NON-NLS-1$
+ }
+ else {
+ msg = RuntimePlugin.Util.getString("datasource_not_found", vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName)); //$NON-NLS-1$
+ }
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_inactivated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
}
- else {
- msg = RuntimePlugin.Util.getString("datasource_not_found", vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName)); //$NON-NLS-1$
- }
- model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_inactivated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
}
- }
+ }
}
}
Deleted: branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java
===================================================================
--- branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -1,138 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright (C) 2008 Red Hat, Inc.
- * Licensed to Red Hat, Inc. under one or more contributor
- * license agreements. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.transport;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.*;
-
-import java.net.InetSocketAddress;
-import java.util.Properties;
-
-import org.junit.After;
-import org.junit.Test;
-import org.teiid.client.security.ILogon;
-import org.teiid.client.security.InvalidSessionException;
-import org.teiid.client.security.LogonException;
-import org.teiid.client.security.LogonResult;
-import org.teiid.client.security.SessionToken;
-import org.teiid.client.util.ResultsFuture;
-import org.teiid.common.buffer.BufferManagerFactory;
-import org.teiid.core.ComponentNotFoundException;
-import org.teiid.core.TeiidComponentException;
-import org.teiid.dqp.service.SessionService;
-import org.teiid.net.CommunicationException;
-import org.teiid.net.ConnectionException;
-import org.teiid.net.HostInfo;
-import org.teiid.net.TeiidURL;
-import org.teiid.net.socket.SocketServerConnection;
-import org.teiid.net.socket.SocketServerConnectionFactory;
-import org.teiid.net.socket.UrlServerDiscovery;
-import org.teiid.transport.TestSocketRemoting.FakeService;
-
-
- at SuppressWarnings("nls")
-public class TestFailover {
-
- SocketListener listener;
- SocketListener listener1;
-
- private SocketServerConnectionFactory sscf;
- private InetSocketAddress addr = new InetSocketAddress(0);
- private int logonAttempts;
-
- @After public void tearDown() {
- if (this.listener != null) {
- this.listener.stop();
- }
- if (this.listener1 != null) {
- this.listener1.stop();
- }
- }
-
- private SocketServerConnection helpEstablishConnection(boolean clientSecure, SSLConfiguration config, Properties socketConfig) throws CommunicationException,
- ConnectionException {
- listener = createListener(addr, config);
- listener1 = createListener(addr, config);
- listener1.stop();
- Properties p = new Properties();
- TeiidURL teiidUrl = new TeiidURL(addr.getHostName(), listener.getPort(), clientSecure);
- teiidUrl.getHostInfo().add(new HostInfo(addr.getHostName(), listener1.getPort()));
- String url = teiidUrl.getAppServerURL();
- p.setProperty(TeiidURL.CONNECTION.SERVER_URL, url);
- p.setProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, UrlServerDiscovery.class.getName());
- p.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
- if (sscf == null) {
- sscf = new SocketServerConnectionFactory();
- sscf.initialize(socketConfig);
- }
- return sscf.getConnection(p);
- }
-
- private SocketListener createListener(InetSocketAddress address, SSLConfiguration config) {
- ClientServiceRegistryImpl server = new ClientServiceRegistryImpl();
- server.registerClientService(ILogon.class, new LogonImpl(mock(SessionService.class), "fakeCluster") { //$NON-NLS-1$
- @Override
- public LogonResult logon(Properties connProps)
- throws LogonException, ComponentNotFoundException {
- logonAttempts++;
- return new LogonResult(new SessionToken("dummy"), "x", 1, "z");
- }
-
- @Override
- public ResultsFuture<?> ping() throws InvalidSessionException,
- TeiidComponentException {
- return ResultsFuture.NULL_FUTURE;
- }
-
- @Override
- public void assertIdentity(SessionToken checkSession)
- throws InvalidSessionException, TeiidComponentException {
- throw new InvalidSessionException();
- }
-
- }, null);
- server.registerClientService(FakeService.class, new TestSocketRemoting.FakeServiceImpl(), null);
- return new SocketListener(address.getPort(), address.getAddress().getHostAddress(), 1024, 1024, 1, config, server, BufferManagerFactory.getStandaloneBufferManager());
- }
-
- @Test public void testFailover() throws Exception {
- SSLConfiguration config = new SSLConfiguration();
- Properties p = new Properties();
- SocketServerConnection conn = helpEstablishConnection(false, config, p);
- assertTrue(conn.isOpen(1000));
- //restart the second instance now that we know the connection was made to the first
- listener1 = createListener(new InetSocketAddress(addr.getAddress(), listener1.getPort()), config);
- listener.stop();
- conn.isOpen(1000); //there is a chance this call can fail
- assertTrue(conn.isOpen(1000));
- listener1.stop();
- //both instances are down
- assertFalse(conn.isOpen(1000));
- //bring the first back up
- listener = createListener(new InetSocketAddress(addr.getAddress(), listener.getPort()), config);
- assertTrue(conn.isOpen(1000));
- assertEquals(3, logonAttempts);
- conn.close();
- }
-
-}
Copied: branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java (from rev 2885, branches/7.1.x/runtime/src/test/java/org/teiid/transport/TestFailover.java)
===================================================================
--- branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java (rev 0)
+++ branches/7.3.x/runtime/src/test/java/org/teiid/transport/TestFailover.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (C) 2008 Red Hat, Inc.
+ * Licensed to Red Hat, Inc. under one or more contributor
+ * license agreements. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.transport;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.net.InetSocketAddress;
+import java.util.Properties;
+
+import org.junit.After;
+import org.junit.Test;
+import org.teiid.client.security.ILogon;
+import org.teiid.client.security.InvalidSessionException;
+import org.teiid.client.security.LogonException;
+import org.teiid.client.security.LogonResult;
+import org.teiid.client.security.SessionToken;
+import org.teiid.client.util.ResultsFuture;
+import org.teiid.common.buffer.BufferManagerFactory;
+import org.teiid.core.ComponentNotFoundException;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.dqp.service.SessionService;
+import org.teiid.net.CommunicationException;
+import org.teiid.net.ConnectionException;
+import org.teiid.net.HostInfo;
+import org.teiid.net.TeiidURL;
+import org.teiid.net.socket.SocketServerConnection;
+import org.teiid.net.socket.SocketServerConnectionFactory;
+import org.teiid.net.socket.UrlServerDiscovery;
+import org.teiid.transport.TestSocketRemoting.FakeService;
+
+
+ at SuppressWarnings("nls")
+public class TestFailover {
+
+ SocketListener listener;
+ SocketListener listener1;
+
+ private SocketServerConnectionFactory sscf;
+ private InetSocketAddress addr = new InetSocketAddress(0);
+ private int logonAttempts;
+
+ @After public void tearDown() {
+ if (this.listener != null) {
+ this.listener.stop();
+ }
+ if (this.listener1 != null) {
+ this.listener1.stop();
+ }
+ }
+
+ private SocketServerConnection helpEstablishConnection(boolean clientSecure, SSLConfiguration config, Properties socketConfig) throws CommunicationException,
+ ConnectionException {
+ listener = createListener(addr, config);
+ listener1 = createListener(addr, config);
+ listener1.stop();
+ Properties p = new Properties();
+ TeiidURL teiidUrl = new TeiidURL(addr.getHostName(), listener.getPort(), clientSecure);
+ teiidUrl.getHostInfo().add(new HostInfo(addr.getHostName(), listener1.getPort()));
+ String url = teiidUrl.getAppServerURL();
+ p.setProperty(TeiidURL.CONNECTION.SERVER_URL, url);
+ p.setProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, UrlServerDiscovery.class.getName());
+ p.setProperty(TeiidURL.CONNECTION.AUTO_FAILOVER, Boolean.TRUE.toString());
+ if (sscf == null) {
+ sscf = new SocketServerConnectionFactory();
+ sscf.initialize(socketConfig);
+ }
+ return sscf.getConnection(p);
+ }
+
+ private SocketListener createListener(InetSocketAddress address, SSLConfiguration config) {
+ ClientServiceRegistryImpl server = new ClientServiceRegistryImpl();
+ server.registerClientService(ILogon.class, new LogonImpl(mock(SessionService.class), "fakeCluster") { //$NON-NLS-1$
+ @Override
+ public LogonResult logon(Properties connProps)
+ throws LogonException, ComponentNotFoundException {
+ logonAttempts++;
+ return new LogonResult(new SessionToken("dummy"), "x", 1, "z");
+ }
+
+ @Override
+ public ResultsFuture<?> ping() throws InvalidSessionException,
+ TeiidComponentException {
+ return ResultsFuture.NULL_FUTURE;
+ }
+
+ @Override
+ public void assertIdentity(SessionToken checkSession)
+ throws InvalidSessionException, TeiidComponentException {
+ throw new InvalidSessionException();
+ }
+
+ }, null);
+ server.registerClientService(FakeService.class, new TestSocketRemoting.FakeServiceImpl(), null);
+ return new SocketListener(address.getPort(), address.getAddress().getHostAddress(), 1024, 1024, 1, config, server, BufferManagerFactory.getStandaloneBufferManager());
+ }
+
+ @Test public void testFailover() throws Exception {
+ SSLConfiguration config = new SSLConfiguration();
+ Properties p = new Properties();
+ SocketServerConnection conn = helpEstablishConnection(false, config, p);
+ assertTrue(conn.isOpen(1000));
+ //restart the second instance now that we know the connection was made to the first
+ listener1 = createListener(new InetSocketAddress(addr.getAddress(), listener1.getPort()), config);
+ listener.stop();
+ conn.isOpen(1000); //there is a chance this call can fail
+ assertTrue(conn.isOpen(1000));
+ listener1.stop();
+ //both instances are down
+ assertFalse(conn.isOpen(1000));
+ //bring the first back up
+ listener = createListener(new InetSocketAddress(addr.getAddress(), listener.getPort()), config);
+ assertTrue(conn.isOpen(1000));
+ assertEquals(3, logonAttempts);
+ conn.close();
+ }
+
+}
Modified: branches/7.3.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- branches/7.3.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -87,7 +87,7 @@
});
DQPConfiguration config = new DQPConfiguration();
- config.setResultsetCacheConfig(new CacheConfiguration(Policy.LRU, 60, 250));
+ config.setResultsetCacheConfig(new CacheConfiguration(Policy.LRU, 60, 250, "resultsetcache")); //$NON-NLS-1$
this.dqp.setCacheFactory(new DefaultCacheFactory());
this.dqp.start(config);
this.sessionService.setDqp(this.dqp);
Modified: branches/7.3.x/test-integration/db/src/main/java/org/teiid/test/util/TestResultSetUtil.java
===================================================================
--- branches/7.3.x/test-integration/db/src/main/java/org/teiid/test/util/TestResultSetUtil.java 2011-01-31 14:52:07 UTC (rev 2885)
+++ branches/7.3.x/test-integration/db/src/main/java/org/teiid/test/util/TestResultSetUtil.java 2011-01-31 15:36:30 UTC (rev 2886)
@@ -39,8 +39,10 @@
import java.util.Collections;
import java.util.List;
+import org.teiid.jdbc.TeiidSQLException;
+
/**
* TestResultSetUtil was built in order to override the {@link #printThrowable(Throwable, PrintStream)} method
* in order to call out.print instead of out.println
@@ -73,8 +75,22 @@
public static void printThrowable(Throwable t, String sql, PrintStream out) {
out.println(sql);
+
+ Throwable answer = t;
+ if (t instanceof TeiidSQLException) {
+ TeiidSQLException sqle = (TeiidSQLException) t;
+ SQLException se = sqle.getNextException();
+ if (se != null) {
+ SQLException s = null;
+ while( (s = se.getNextException()) != null) {
+ se = s;
+ }
+
+ answer = se;
+ }
+ }
- out.print(t.getClass().getName() + " : " + t.getMessage()); //$NON-NLS-1$
+ out.print(t.getClass().getName() + " : " + answer.getMessage()); //$NON-NLS-1$
}
More information about the teiid-commits
mailing list