teiid SVN: r1180 - trunk/engine/src/main/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-23 17:06:42 -0400 (Thu, 23 Jul 2009)
New Revision: 1180
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
Log:
TEIID-733 changing from a shutdown to a shutdownnow in dqpcore to help ensure that workers do not see invalid states
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-07-23 20:52:39 UTC (rev 1179)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-07-23 21:06:42 UTC (rev 1180)
@@ -156,14 +156,12 @@
private ServiceLoader loader = new ServiceLoader();
/**
- * perform a graceful shutdown by allowing in process work to complete
- * TODO: this is not quite correct from a request perspective, since we need to re-queue in many instances,
- * which will now result in an exception
+ * perform a full shutdown and wait for 10 seconds for all threads to finish
* @throws ApplicationLifecycleException
*/
@Override
public void stop() throws ApplicationLifecycleException {
- processWorkerPool.shutdown();
+ processWorkerPool.shutdownNow();
try {
processWorkerPool.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
15 years, 7 months
teiid SVN: r1179 - trunk/runtime/src/main/java/org/teiid/transport.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-23 16:52:39 -0400 (Thu, 23 Jul 2009)
New Revision: 1179
Modified:
trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
Log:
TEIID-734: This exception was happening for two reasons. One Channel handler was throwing a exception when the channel is closed, even when the client requested it. And ping call was being used with invalid session, instead just pinging the server instance. Both were corrected.
Modified: trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2009-07-23 20:48:25 UTC (rev 1178)
+++ trunk/runtime/src/main/java/org/teiid/transport/LogonImpl.java 2009-07-23 20:52:39 UTC (rev 1179)
@@ -144,9 +144,19 @@
return sessionID;
}
+ private void resetDQPContext() {
+ DQPWorkContext workContext = DQPWorkContext.getWorkContext();
+ workContext.setSessionToken(null);
+ workContext.setAppName(null);
+ workContext.setTrustedPayload(null);
+ workContext.setVdbName(null);
+ workContext.setVdbVersion(null);
+ }
+
public ResultsFuture<?> logoff() throws InvalidSessionException, MetaMatrixComponentException {
try {
this.service.closeSession(DQPWorkContext.getWorkContext().getSessionId());
+ resetDQPContext();
} catch (SessionServiceException e) {
throw new MetaMatrixComponentException(e);
}
@@ -154,7 +164,12 @@
}
public ResultsFuture<?> ping() throws InvalidSessionException,MetaMatrixComponentException {
- this.service.pingServer(DQPWorkContext.getWorkContext().getSessionId());
+ // ping is double used to alert the aliveness of the client, as well as check the server instance is
+ // alive by socket server instance, so that they can be cached.
+ MetaMatrixSessionID id = DQPWorkContext.getWorkContext().getSessionId();
+ if (id != null) {
+ this.service.pingServer(id);
+ }
return null;
}
Modified: trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2009-07-23 20:48:25 UTC (rev 1178)
+++ trunk/runtime/src/main/java/org/teiid/transport/SSLAwareChannelHandler.java 2009-07-23 20:52:39 UTC (rev 1179)
@@ -54,9 +54,10 @@
import org.jboss.netty.handler.codec.serialization.ObjectEncoder;
import org.jboss.netty.handler.ssl.SslHandler;
-import com.metamatrix.common.comm.exception.SingleInstanceCommunicationException;
import com.metamatrix.common.comm.platform.CommPlatformPlugin;
import com.metamatrix.common.comm.platform.socket.ObjectChannel;
+import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.util.LogConstants;
/**
* Main class for creating Netty Nio Channels
@@ -216,7 +217,7 @@
ChannelStateEvent e) throws Exception {
ChannelListener listener = this.listeners.remove(e.getChannel());
if (listener != null) {
- listener.exceptionOccurred(new SingleInstanceCommunicationException(CommPlatformPlugin.Util.getString("SSLAwareChannelHandler.channel_closed"))); //$NON-NLS-1$
+ LogManager.logDetail(LogConstants.CTX_SERVER, CommPlatformPlugin.Util.getString("SSLAwareChannelHandler.channel_closed")); //$NON-NLS-1$
}
}
15 years, 7 months
teiid SVN: r1178 - trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-23 16:48:25 -0400 (Thu, 23 Jul 2009)
New Revision: 1178
Modified:
trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
Log:
removing unused imports
Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-07-23 20:32:49 UTC (rev 1177)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnectionFactory.java 2009-07-23 20:48:25 UTC (rev 1178)
@@ -29,9 +29,7 @@
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.InetAddress;
-import java.net.URL;
import java.net.UnknownHostException;
-import java.sql.SQLException;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -43,15 +41,11 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.teiid.adminapi.Admin;
-import org.teiid.adminapi.AdminException;
-
import com.metamatrix.common.api.HostInfo;
import com.metamatrix.common.api.MMURL;
import com.metamatrix.common.comm.api.ServerConnectionFactory;
import com.metamatrix.common.comm.exception.CommunicationException;
import com.metamatrix.common.comm.exception.ConnectionException;
-import com.metamatrix.common.comm.platform.client.ServerAdminFactory;
import com.metamatrix.common.util.NetUtils;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.MetaMatrixCoreException;
15 years, 7 months
teiid SVN: r1177 - trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-23 16:32:49 -0400 (Thu, 23 Jul 2009)
New Revision: 1177
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
Log:
TEIID-738 added the ability to resolve nested connector binding properties
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-07-23 18:52:11 UTC (rev 1176)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-07-23 20:32:49 UTC (rev 1177)
@@ -348,7 +348,8 @@
connectorWorkerPool = WorkerPoolFactory.newWorkerPool(connectorName, maxThreads);
// Create the Connector env
- Properties clonedProps = PropertiesUtils.clone(props);
+ Properties clonedProps = PropertiesUtils.resolveNestedProperties(props);
+
ConnectorEnvironment connectorEnv = new ConnectorEnvironmentImpl(clonedProps, new DefaultConnectorLogger(connectorID), env, connectorWorkerPool);
// Get the metadata service
15 years, 7 months
teiid SVN: r1176 - trunk/build/kit-runtime/bin.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-23 14:52:11 -0400 (Thu, 23 Jul 2009)
New Revision: 1176
Removed:
trunk/build/kit-runtime/bin/encrypt.bat
trunk/build/kit-runtime/bin/encrypt.sh
Log:
TEIID-729: No longer creates a keystore by running the server script. To generate the key user must run the keystore.sh or keystore.bat script file.
Deleted: trunk/build/kit-runtime/bin/encrypt.bat
===================================================================
--- trunk/build/kit-runtime/bin/encrypt.bat 2009-07-23 18:51:36 UTC (rev 1175)
+++ trunk/build/kit-runtime/bin/encrypt.bat 2009-07-23 18:52:11 UTC (rev 1176)
@@ -1,45 +0,0 @@
-@echo off
-rem
-rem This script file encrypts the passed in clear text and spits out encypted form
-rem
-
-@if not "%ECHO%" == "" echo %ECHO%
-@if "%OS%" == "Windows_NT" setlocal
-
-if "%OS%" == "Windows_NT" (
- set "DIRNAME=%~dp0%"
-) else (
- set DIRNAME=.\
-)
-
-pushd %DIRNAME%..
-if "x%TEIID_HOME%" == "x" (
- set "TEIID_HOME=%CD%"
-)
-popd
-
-set DIRNAME=
-
-if "x%JAVA_HOME%" == "x" (
- set JAVA=java
- echo JAVA_HOME is not set. Unexpected results may occur.
- echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
-) else (
- set "JAVA=%JAVA_HOME%\bin\java"
- if exist "%JAVA_HOME%\lib\tools.jar" (
- set "JAVAC_JAR=%JAVA_HOME%\lib\tools.jar"
- )
-)
-
-set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\deploy;%TEIID_HOME%\client\*;%TEIID_HOME%\lib\*;
-set KEYSTORE_FILE=%TEIID_HOME%\deploy\teiid.keystore
-if not exist %KEYSTORE_FILE (
- %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
- echo A new key with keystore generated at %KEYSTORE_FILE%
-)
-
-if "x%1%" == "x"(
- echo Provide text phrase to encrypt.
-) else (
- %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -key %KEYSTORE_FILE% -encrypt %1%
-)
Deleted: trunk/build/kit-runtime/bin/encrypt.sh
===================================================================
--- trunk/build/kit-runtime/bin/encrypt.sh 2009-07-23 18:51:36 UTC (rev 1175)
+++ trunk/build/kit-runtime/bin/encrypt.sh 2009-07-23 18:52:11 UTC (rev 1176)
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-DIRNAME=`dirname $0`
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false;
-linux=false;
-case "`uname`" in
- CYGWIN*)
- cygwin=true
- ;;
-
- Linux)
- linux=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$TEIID_HOME" ] &&
- TEIID_HOME=`cygpath --unix "$TEIID_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Setup TEIID_HOME
-if [ "x$TEIID_HOME" = "x" ]; then
- # get the full path (without any relative bits)
- TEIID_HOME=`cd $DIRNAME/..; pwd`
-fi
-export TEIID_HOME
-
-# Setup the JVM
-if [ "x$JAVA" = "x" ]; then
- if [ "x$JAVA_HOME" != "x" ]; then
- JAVA="$JAVA_HOME/bin/java"
- else
- JAVA="java"
- fi
-fi
-
-TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/deploy:$TEIID_HOME/client/*:$TEIID_HOME/lib/*"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- TEIID_HOME=`cygpath --path --windows "$TEIID_HOME"`
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- TEIID_CLASSPATH=`cygpath --path --windows "$TEIID_CLASSPATH"`
-fi
-
-# generate teiid.keystore if does not exist.
-KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
-if [ ! -f $KEYSTORE_FILE ]; then
- "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
- echo "A new key with keystore generated at $KEYSTORE_FILE"
-fi
-
-if [ "x$1" = "x" ]; then
- echo "Provide text phrase to encrypt."
-else
- "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -key $KEYSTORE_FILE -encrypt $1
-fi
\ No newline at end of file
15 years, 7 months
teiid SVN: r1175 - trunk/build/kit-runtime/bin.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-23 14:51:36 -0400 (Thu, 23 Jul 2009)
New Revision: 1175
Added:
trunk/build/kit-runtime/bin/keystore.bat
trunk/build/kit-runtime/bin/keystore.sh
Modified:
trunk/build/kit-runtime/bin/run.bat
trunk/build/kit-runtime/bin/run.sh
trunk/build/kit-runtime/bin/shutdown.bat
Log:
TEIID-729: No longer creates a keystore by running the server script. To generate the key user must run the keystore.sh or keystore.bat script file.
Added: trunk/build/kit-runtime/bin/keystore.bat
===================================================================
--- trunk/build/kit-runtime/bin/keystore.bat (rev 0)
+++ trunk/build/kit-runtime/bin/keystore.bat 2009-07-23 18:51:36 UTC (rev 1175)
@@ -0,0 +1,71 @@
+@echo off
+rem
+rem This script file encrypts the passed in clear text and spits out encypted form
+rem
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+ set "DIRNAME=%~dp0%"
+) else (
+ set DIRNAME=.\
+)
+
+pushd %DIRNAME%..
+if "x%TEIID_HOME%" == "x" (
+ set "TEIID_HOME=%CD%"
+)
+popd
+
+set DIRNAME=
+
+if "x%JAVA_HOME%" == "x" (
+ set JAVA=java
+ echo JAVA_HOME is not set. Unexpected results may occur.
+ echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
+) else (
+ set "JAVA=%JAVA_HOME%\bin\java"
+ if exist "%JAVA_HOME%\lib\tools.jar" (
+ set "JAVAC_JAR=%JAVA_HOME%\lib\tools.jar"
+ )
+)
+
+set TEIID_CLASSPATH=%TEIID_HOME%\lib\patches\*;%TEIID_HOME%\deploy;%TEIID_HOME%\client\*;%TEIID_HOME%\lib\*;
+set KEYSTORE_FILE=%TEIID_HOME%\deploy\teiid.keystore
+
+if "x%1%" == "x" (
+ goto prompt
+) else (
+ if "%1%" == "-create" (
+ if not exist %KEYSTORE_FILE% (
+ "%JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
+ echo A new key with keystore generated at %KEYSTORE_FILE%
+ ) else (
+ echo %KEYSTORE_FILE% already exists. Delete the current one if you would like to create a new keystore.
+ )
+ ) else (
+ if "%1%" == "-encrypt" (
+ if NOT "x%2%" == "x" (
+ if exist %KEYSTORE_FILE% (
+ "%JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -key %KEYSTORE_FILE% -encrypt %2%
+ ) else (
+ echo %KEYSTORE_FILE% not found. Create a keystore first by using
+ echo usage:%0% -create
+ )
+ ) else (
+ goto prompt
+ )
+ ) else (
+ goto prompt
+ )
+ )
+)
+goto end
+
+:prompt
+ echo usage:%0% -create
+ echo usage:%0% -encrypt plain-text-password
+goto end
+
+:end
\ No newline at end of file
Added: trunk/build/kit-runtime/bin/keystore.sh
===================================================================
--- trunk/build/kit-runtime/bin/keystore.sh (rev 0)
+++ trunk/build/kit-runtime/bin/keystore.sh 2009-07-23 18:51:36 UTC (rev 1175)
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+DIRNAME=`dirname $0`
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+linux=false;
+case "`uname`" in
+ CYGWIN*)
+ cygwin=true
+ ;;
+
+ Linux)
+ linux=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$TEIID_HOME" ] &&
+ TEIID_HOME=`cygpath --unix "$TEIID_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Setup TEIID_HOME
+if [ "x$TEIID_HOME" = "x" ]; then
+ # get the full path (without any relative bits)
+ TEIID_HOME=`cd $DIRNAME/..; pwd`
+fi
+export TEIID_HOME
+
+# Setup the JVM
+if [ "x$JAVA" = "x" ]; then
+ if [ "x$JAVA_HOME" != "x" ]; then
+ JAVA="$JAVA_HOME/bin/java"
+ else
+ JAVA="java"
+ fi
+fi
+
+TEIID_CLASSPATH="$TEIID_HOME/lib/patches/*:$TEIID_HOME/deploy:$TEIID_HOME/client/*:$TEIID_HOME/lib/*"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ TEIID_HOME=`cygpath --path --windows "$TEIID_HOME"`
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ TEIID_CLASSPATH=`cygpath --path --windows "$TEIID_CLASSPATH"`
+fi
+
+prompt() {
+ echo "usage:$0 -create"
+ echo "usage:$0 -encrypt <plain-text-password> "
+}
+
+KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
+
+if [ $# -eq 0 ]
+then
+ prompt;
+else
+ if [ "${1}" = "-create" ]
+ then
+ # generate teiid.keystore if does not exist.
+ if [ ! -f $KEYSTORE_FILE ]; then
+ "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
+ echo "A new key with keystore generated at $KEYSTORE_FILE"
+ else
+ echo "$KEYSTORE_FILE already exists. Delete the current one if you would like to create a new keystore"
+ fi
+ else
+ if [ "${1}" = "-encrypt" -a "${2}" != "" ]; then
+ if [ -f $KEYSTORE_FILE ]; then
+ "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -key $KEYSTORE_FILE -encrypt $2
+ else
+ echo "$KEYSTORE_FILE not found. Create a keystore first by using "
+ echo "$0 -create"
+ fi
+ else
+ prompt
+ fi
+ fi
+fi
Modified: trunk/build/kit-runtime/bin/run.bat
===================================================================
--- trunk/build/kit-runtime/bin/run.bat 2009-07-23 17:54:32 UTC (rev 1174)
+++ trunk/build/kit-runtime/bin/run.bat 2009-07-23 18:51:36 UTC (rev 1175)
@@ -47,13 +47,6 @@
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
-rem Generate teiid.keystore file
-set KEYSTORE_FILE=%TEIID_HOME%\deploy\teiid.keystore
-if not exist %KEYSTORE_FILE% (
- %JAVA%" -classpath "%TEIID_CLASSPATH%" com.metamatrix.common.util.crypto.CryptoUtil -genkey %KEYSTORE_FILE%
- echo A new key with keystore generated at %KEYSTORE_FILE%
-)
-
cd %TEIID_HOME%
set JAVA_OPTS=%JAVA_OPTS% -Dteiid.home=%TEIID_HOME%
@@ -81,6 +74,4 @@
if ERRORLEVEL 10 goto RESTART
:END
-if "x%NOPAUSE%" == "x" pause
-:END_NO_PAUSE
Modified: trunk/build/kit-runtime/bin/run.sh
===================================================================
--- trunk/build/kit-runtime/bin/run.sh 2009-07-23 17:54:32 UTC (rev 1174)
+++ trunk/build/kit-runtime/bin/run.sh 2009-07-23 18:51:36 UTC (rev 1175)
@@ -67,13 +67,6 @@
TEIID_CLASSPATH=`cygpath --path --windows "$TEIID_CLASSPATH"`
fi
-# generate teiid.keystore if does not exist.
-KEYSTORE_FILE=$TEIID_HOME/deploy/teiid.keystore
-if [ ! -f $KEYSTORE_FILE ]; then
- "$JAVA" -classpath $TEIID_CLASSPATH com.metamatrix.common.util.crypto.CryptoUtil -genkey $KEYSTORE_FILE
- echo "A new key with keystore generated at $KEYSTORE_FILE"
-fi
-
JAVA_OPTS="$JAVA_OPTS -Dteiid.home=$TEIID_HOME"
# Display our environment
Modified: trunk/build/kit-runtime/bin/shutdown.bat
===================================================================
--- trunk/build/kit-runtime/bin/shutdown.bat 2009-07-23 17:54:32 UTC (rev 1174)
+++ trunk/build/kit-runtime/bin/shutdown.bat 2009-07-23 18:51:36 UTC (rev 1175)
@@ -64,15 +64,8 @@
echo ===============================================================================
echo.
-:RESTART
"%JAVA%" %JAVA_OPTS% ^
- -classpath "%JBOSS_CLASSPATH%" ^
+ -classpath "%TEIID_CLASSPATH%" ^
-server ^
org.teiid.Shutdown %TEIID_HOME%\deploy.properties %JMX_PORT% %*
-if ERRORLEVEL 10 goto RESTART
-
-:END
-if "x%NOPAUSE%" == "x" pause
-
-:END_NO_PAUSE
15 years, 7 months
teiid SVN: r1174 - trunk.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2009-07-23 13:54:32 -0400 (Thu, 23 Jul 2009)
New Revision: 1174
Modified:
trunk/pom.xml
Log:
TEIID-737: upgrading to 1.2.14 as the JBoss Maven does not have .15 yet in the repository. The bug is fixed in .12
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-07-22 22:30:58 UTC (rev 1173)
+++ trunk/pom.xml 2009-07-23 17:54:32 UTC (rev 1174)
@@ -380,7 +380,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.8</version>
+ <version>1.2.14</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
15 years, 7 months
Warning: could not send message for past 4 hours
by Mail Delivery Subsystem
**********************************************
** THIS IS A WARNING MESSAGE ONLY **
** YOU DO NOT NEED TO RESEND YOUR MESSAGE **
**********************************************
The original message was received at Wed, 22 Jul 2009 18:30:58 -0400
from svn01.web.mwc.hst.phx2.redhat.com [10.5.105.7]
----- Transcript of session follows -----
<teiid-commits(a)lists.jboss.org>... Deferred: Connection refused by mx1.lists.jboss.org.
Warning: message still undelivered after 4 hours
Will keep trying until message is 5 days old
15 years, 7 months
teiid SVN: r1173 - in trunk: common-core/src/test/java/com/metamatrix/common/types and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-07-22 18:30:58 -0400 (Wed, 22 Jul 2009)
New Revision: 1173
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java
trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java
trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java
Log:
TEIID-736 fixing type mappings
Modified: trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-07-22 17:08:37 UTC (rev 1172)
+++ trunk/common-core/src/main/java/com/metamatrix/common/types/MMJDBCSQLTypeInfo.java 2009-07-22 22:30:58 UTC (rev 1173)
@@ -99,30 +99,25 @@
private static Map<String, String> CLASSNAME_TO_NAME = new HashMap<String, String>();
static {
- addTypeMapping(STRING, STRING_CLASS, Types.VARCHAR);
- TYPE_TO_NAME_MAP.put(Types.LONGVARCHAR, STRING);
+ addTypeMapping(STRING, STRING_CLASS, Types.VARCHAR, Types.LONGVARCHAR, Types.CHAR);
+ addTypeMapping(CHAR, CHAR_CLASS, Types.CHAR, false);
addTypeMapping(BOOLEAN, BOOLEAN_CLASS, Types.BIT);
addTypeMapping(TIME, TIME_CLASS, Types.TIME);
addTypeMapping(DATE, DATE_CLASS, Types.DATE);
addTypeMapping(TIMESTAMP, TIMESTAMP_CLASS, Types.TIMESTAMP);
addTypeMapping(INTEGER, INTEGER_CLASS, Types.INTEGER);
addTypeMapping(FLOAT, FLOAT_CLASS, Types.REAL);
- addTypeMapping(DOUBLE, DOUBLE_CLASS, Types.DOUBLE);
- TYPE_TO_NAME_MAP.put(Types.FLOAT, DOUBLE);
- addTypeMapping(BIGDECIMAL, BIGDECIMAL_CLASS, Types.NUMERIC);
- TYPE_TO_NAME_MAP.put(Types.DECIMAL, BIGDECIMAL);
- NAME_TO_CLASSNAME.put(BIGINTEGER, BIGINTEGER_CLASS);
- CLASSNAME_TO_NAME.put(BIGINTEGER_CLASS, BIGINTEGER);
- NAME_TO_TYPE_MAP.put(BIGINTEGER, Types.NUMERIC);
+ addTypeMapping(DOUBLE, DOUBLE_CLASS, Types.DOUBLE, Types.FLOAT);
+ addTypeMapping(BIGDECIMAL, BIGDECIMAL_CLASS, Types.NUMERIC, Types.DECIMAL);
+ addTypeMapping(BIGINTEGER, BIGINTEGER_CLASS, Types.NUMERIC, false);
addTypeMapping(BYTE, BYTE_CLASS, Types.TINYINT);
addTypeMapping(SHORT, SHORT_CLASS, Types.SMALLINT);
addTypeMapping(LONG, LONG_CLASS, Types.BIGINT);
- addTypeMapping(CHAR, CHAR_CLASS, Types.CHAR);
addTypeMapping(OBJECT, OBJECT_CLASS, Types.JAVA_OBJECT);
addTypeMapping(CLOB, CLOB_CLASS, Types.CLOB);
- addTypeMapping(BLOB, BLOB_CLASS, Types.BLOB);
+ addTypeMapping(BLOB, BLOB_CLASS, Types.BLOB, Types.BINARY, Types.VARBINARY, Types.LONGVARBINARY);
- addTypeMapping(NULL, null, Types.NUMERIC);
+ addTypeMapping(NULL, null, Types.NULL);
//## JDBC4.0-begin ##
addTypeMapping(XML, XML_CLASS, Types.SQLXML);
@@ -137,9 +132,18 @@
## JDBC3.0-JDK1.5-end ##*/
}
- private static void addTypeMapping(String typeName, String javaClass, int sqlType) {
+ private static void addTypeMapping(String typeName, String javaClass, int sqlType, int ... secondaryTypes) {
+ addTypeMapping(typeName, javaClass, sqlType, true);
+ for (int type : secondaryTypes) {
+ TYPE_TO_NAME_MAP.put(type, typeName);
+ }
+ }
+
+ private static void addTypeMapping(String typeName, String javaClass, int sqlType, boolean preferedType) {
NAME_TO_TYPE_MAP.put(typeName, sqlType);
- TYPE_TO_NAME_MAP.put(sqlType, typeName);
+ if (preferedType) {
+ TYPE_TO_NAME_MAP.put(sqlType, typeName);
+ }
if (javaClass != null) {
NAME_TO_CLASSNAME.put(typeName, javaClass);
CLASSNAME_TO_NAME.put(javaClass, typeName);
Modified: trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java 2009-07-22 17:08:37 UTC (rev 1172)
+++ trunk/common-core/src/test/java/com/metamatrix/common/types/TestDataTypeManager.java 2009-07-22 22:30:58 UTC (rev 1173)
@@ -185,8 +185,12 @@
}
}
- assertEquals(MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.TIMESTAMP), Types.TIMESTAMP);
- assertEquals(MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.XML), Types.SQLXML);
+ assertEquals(Types.TIMESTAMP, MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.TIMESTAMP));
+ //## JDBC4.0-begin ##
+ assertEquals(Types.SQLXML, MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.XML));
+ //## JDBC4.0-end ##
+ assertEquals(DataTypeManager.DefaultDataTypes.STRING, MMJDBCSQLTypeInfo.getTypeName(Types.CHAR));
+ assertEquals(Types.CHAR, MMJDBCSQLTypeInfo.getSQLTypeFromRuntimeType(DataTypeManager.DefaultDataClasses.CHAR));
}
public void testRuntimeTypeConversion() throws Exception {
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-22 17:08:37 UTC (rev 1172)
+++ trunk/test-integration/src/test/java/com/metamatrix/server/integration/TestVDBLessExecution.java 2009-07-22 22:30:58 UTC (rev 1173)
@@ -52,7 +52,7 @@
@Test public void testIntegrationExecution() {
getConnection(VDB, DQP_PROP_FILE);
executeAndAssertResults("select * from Example, Smalla where notional = intkey", new String[] { //$NON-NLS-1$
- "TRADEID[string] NOTIONAL[integer] INTKEY[integer] STRINGKEY[string] INTNUM[integer] STRINGNUM[string] FLOATNUM[float] LONGNUM[long] DOUBLENUM[double] BYTENUM[short] DATEVALUE[date] TIMEVALUE[time] TIMESTAMPVALUE[timestamp] BOOLEANVALUE[short] CHARVALUE[char] SHORTVALUE[short] BIGINTEGERVALUE[long] BIGDECIMALVALUE[bigdecimal] OBJECTVALUE[string]", //$NON-NLS-1$
+ "TRADEID[string] NOTIONAL[integer] INTKEY[integer] STRINGKEY[string] INTNUM[integer] STRINGNUM[string] FLOATNUM[float] LONGNUM[long] DOUBLENUM[double] BYTENUM[short] DATEVALUE[date] TIMEVALUE[time] TIMESTAMPVALUE[timestamp] BOOLEANVALUE[short] CHARVALUE[string] SHORTVALUE[short] BIGINTEGERVALUE[long] BIGDECIMALVALUE[bigdecimal] OBJECTVALUE[string]", //$NON-NLS-1$
"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$
});
@@ -125,7 +125,7 @@
"null VDBLess Derby.SMALLA TIMEVALUE 92 time 8 null 0 10 1 null null null null 0 10 NO null null null null NO", //$NON-NLS-1$
"null VDBLess Derby.SMALLA TIMESTAMPVALUE 93 timestamp 29 null 0 10 1 null null null null 0 11 NO null null null null NO", //$NON-NLS-1$
"null VDBLess Derby.SMALLA BOOLEANVALUE 5 short 5 null 0 10 1 null null null null 0 12 NO null null null null NO", //$NON-NLS-1$
- "null VDBLess Derby.SMALLA CHARVALUE 1 char 1 null 0 0 1 null null null null 2 13 NO null null null null NO", //$NON-NLS-1$
+ "null VDBLess Derby.SMALLA CHARVALUE 12 string 4000 null 0 0 1 null null null null 2 13 NO null null null null NO", //$NON-NLS-1$
"null VDBLess Derby.SMALLA SHORTVALUE 5 short 5 null 0 10 1 null null null null 0 14 NO null null null null NO", //$NON-NLS-1$
"null VDBLess Derby.SMALLA BIGINTEGERVALUE -5 long 19 null 0 10 1 null null null null 0 15 NO null null null null NO", //$NON-NLS-1$
"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$
15 years, 7 months