[jbpm-commits] JBoss JBPM SVN: r3544 - in jbpm3/branches/aguizar: hudson and 5 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 24 11:41:35 EST 2008
Author: alex.guizar at jboss.com
Date: 2008-12-24 11:41:35 -0500 (Wed, 24 Dec 2008)
New Revision: 3544
Added:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
Modified:
jbpm3/branches/aguizar/hudson/hudson-home/command.sh
jbpm3/branches/aguizar/hudson/profiles.xml.local.qa
jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.properties.sybase.xml
jbpm3/branches/aguizar/modules/core/src/main/resources/jbpm-sybase-ds.xml
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
jbpm3/branches/aguizar/modules/enterprise/pom.xml
jbpm3/branches/aguizar/pom.xml
jbpm3/branches/aguizar/profiles.xml.example
Log:
Switch back to jConnect for XA support
Workaround for IOException "JZ0SL: Unsupported SQL type: 2005"
Modified: jbpm3/branches/aguizar/hudson/hudson-home/command.sh
===================================================================
--- jbpm3/branches/aguizar/hudson/hudson-home/command.sh 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/hudson/hudson-home/command.sh 2008-12-24 16:41:35 UTC (rev 3544)
@@ -70,6 +70,14 @@
rm $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar/slf4j-api.jar
fi
+# FIXME: find out whether jTDS can be made to work with XA data source
+# https://jira.jboss.org/jira/browse/JBPM-1818
+SYBASE_JDBC_DRIVER=~/.m2/repository/com/sybase/jconnect/6.0.5/jconnect-6.0.5.jar
+if [ -f $SYBASE_JDBC_DRIVER ]; then
+ echo "cp $SYBASE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar"
+ cp $SYBASE_JDBC_DRIVER $JBOSS_HOME/server/$JBOSS_SERVER/deploy/jbpm/jbpm-service.sar
+fi
+
#
# start jbossas
#
Modified: jbpm3/branches/aguizar/hudson/profiles.xml.local.qa
===================================================================
--- jbpm3/branches/aguizar/hudson/profiles.xml.local.qa 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/hudson/profiles.xml.local.qa 2008-12-24 16:41:35 UTC (rev 3544)
@@ -12,25 +12,25 @@
</activation>
<properties>
- <jdbc.mysql.url>jdbc:mysql://localhost:3306/jbpmtest</jdbc.mysql.url>
<jdbc.mysql.server>localhost</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
<jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
+ <jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
<jdbc.mysql.username>jbpmtest</jdbc.mysql.username>
<jdbc.mysql.password></jdbc.mysql.password>
- <jdbc.sybase.url>jdbc:jtds:sybase://192.168.0.101:5000/jbpmtest</jdbc.sybase.url>
- <jdbc.sybase.server>192.168.0.101</jdbc.sybase.server>
+ <jdbc.sybase.server>localhost</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
<jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
<jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
<!-- PostgreSQL is currently not supported
- <jdbc.postgresql.url>jdbc:postgresql://localhost:5432/jbpmtest</jdbc.postgresql.url>
<jdbc.postgresql.server>localhost</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
<jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
+ <jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
<jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
<jdbc.postgresql.password></jdbc.postgresql.password>
-->
Added: jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java (rev 0)
+++ jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java 2008-12-24 16:41:35 UTC (rev 3544)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This 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 software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.db.hibernate;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Serializable;
+import java.io.StringReader;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+import org.hibernate.type.Type;
+import org.hibernate.usertype.UserType;
+import org.hibernate.util.EqualsHelper;
+import org.hibernate.util.StringHelper;
+
+/**
+ * @author Alejandro Guizar
+ */
+public class TextType implements UserType, Serializable {
+
+ private transient Log log;
+ private static final boolean IS_VALUE_TRACING_ENABLED = LogFactory.getLog(StringHelper
+ .qualifier(Type.class.getName())).isTraceEnabled();
+
+ private static final long serialVersionUID = 1L;
+
+ private Log log() {
+ if (log == null) {
+ log = LogFactory.getLog(getClass());
+ }
+ return log;
+ }
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ if (cached == null) {
+ return null;
+ }
+ else {
+ return deepCopy(cached);
+ }
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ return value;
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ if (value == null) {
+ return null;
+ }
+ else {
+ return (Serializable) deepCopy(value);
+ }
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ return EqualsHelper.equals(x, y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return x.hashCode();
+ }
+
+ public boolean isMutable() {
+ return false;
+ }
+
+ public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException,
+ SQLException {
+ return nullSafeGet(rs, names[0]);
+ }
+
+ public Object nullSafeGet(ResultSet rs, String name) throws HibernateException, SQLException {
+ try {
+ Object value = get(rs, name);
+ if (value == null) {
+ if (IS_VALUE_TRACING_ENABLED) {
+ log().trace("returning null as column: " + name);
+ }
+ return null;
+ }
+ else {
+ if (IS_VALUE_TRACING_ENABLED) {
+ log().trace("returning '" + toString(value) + "' as column: " + name);
+ }
+ return value;
+ }
+ }
+ catch (RuntimeException re) {
+ log().info("could not read column value from result set: " + name + "; " + re.getMessage());
+ throw re;
+ }
+ catch (SQLException se) {
+ log().info("could not read column value from result set: " + name + "; " + se.getMessage());
+ throw se;
+ }
+ }
+
+ public Object get(ResultSet rs, String name) throws HibernateException, SQLException {
+ // retrieve the value of the designated column in the current row of the
+ // result set as a character reader
+ Reader charReader = rs.getCharacterStream(name);
+
+ // if the corresponding SQL value is NULL, the reader we got is NULL as well
+ if (charReader == null || rs.wasNull())
+ return null;
+
+ // Fetch Reader content up to the end - and put characters in a StringBuffer
+ StringBuffer sbuf = new StringBuffer();
+ try {
+ char[] cbuf = new char[1024];
+ for (int amountRead; (amountRead = charReader.read(cbuf)) != -1;) {
+ sbuf.append(cbuf, 0, amountRead);
+ }
+ }
+ catch (IOException ioe) {
+ throw new HibernateException("IOException occurred reading text", ioe);
+ }
+ finally {
+ try {
+ charReader.close();
+ }
+ catch (IOException e) {
+ throw new HibernateException("IOException occurred closing stream", e);
+ }
+ }
+
+ // Return StringBuffer content as a large String
+ return sbuf.toString();
+ }
+
+ public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException,
+ SQLException {
+ try {
+ if (value == null) {
+ if (IS_VALUE_TRACING_ENABLED) {
+ log().trace("binding null to parameter: " + index);
+ }
+
+ setNull(st, index);
+ }
+ else {
+ if (IS_VALUE_TRACING_ENABLED) {
+ log().trace("binding '" + toString(value) + "' to parameter: " + index);
+ }
+
+ set(st, value, index);
+ }
+ }
+ catch (RuntimeException re) {
+ log().info("could not bind value '" + nullSafeToString(value)
+ + "' to parameter: "
+ + index
+ + "; "
+ + re.getMessage());
+ throw re;
+ }
+ catch (SQLException se) {
+ log().info("could not bind value '" + nullSafeToString(value)
+ + "' to parameter: "
+ + index
+ + "; "
+ + se.getMessage());
+ throw se;
+ }
+ }
+
+ public void set(PreparedStatement st, Object value, int index) throws HibernateException,
+ SQLException {
+ String str = (String) value;
+ st.setCharacterStream(index, new StringReader(str), str.length());
+ }
+
+ public void setNull(PreparedStatement st, int index) throws HibernateException, SQLException {
+ st.setCharacterStream(index, null, 0);
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+
+ public Class returnedClass() {
+ return String.class;
+ }
+
+ public int[] sqlTypes() {
+ return new int[] { Types.CLOB };
+ }
+
+ public String nullSafeToString(Object value) throws HibernateException {
+ return value == null ? null : toString(value);
+ }
+
+ public String toString(Object val) {
+ return (String) val;
+ }
+}
Modified: jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.properties.sybase.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.properties.sybase.xml 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.properties.sybase.xml 2008-12-24 16:41:35 UTC (rev 3544)
@@ -13,8 +13,11 @@
<property name="hibernate.dialect">org.hibernate.dialect.SybaseDialect</property>
<!-- JDBC connection properties (begin) -->
- <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
+ <property name="hibernate.connection.driver_class">${jdbc.sybase.driver}</property>
<property name="hibernate.connection.url">${jdbc.sybase.url}</property>
<property name="hibernate.connection.username">${jdbc.sybase.username}</property>
<property name="hibernate.connection.password">${jdbc.sybase.password}</property>
<!-- JDBC connection properties (end) -->
+
+ <!-- jConnect does not support retrieving natively generated keys after insert -->
+ <property name="hibernate.jdbc.use_get_generated_keys">false</property>
Modified: jbpm3/branches/aguizar/modules/core/src/main/resources/jbpm-sybase-ds.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/resources/jbpm-sybase-ds.xml 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/modules/core/src/main/resources/jbpm-sybase-ds.xml 2008-12-24 16:41:35 UTC (rev 3544)
@@ -5,13 +5,16 @@
<xa-datasource>
<jndi-name>JbpmDS</jndi-name>
- <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
+ <xa-datasource-class>${jdbc.sybase.datasource}</xa-datasource-class>
<xa-datasource-property name="ServerName">${jdbc.sybase.server}</xa-datasource-property>
<xa-datasource-property name="PortNumber">${jdbc.sybase.port}</xa-datasource-property>
<xa-datasource-property name="DatabaseName">${jdbc.sybase.database}</xa-datasource-property>
<xa-datasource-property name="User">${jdbc.sybase.username}</xa-datasource-property>
<xa-datasource-property name="Password">${jdbc.sybase.password}</xa-datasource-property>
+ <!-- disable transaction interleaving -->
+ <track-connection-by-tx />
+
<exception-sorter-class-name>
org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter
</exception-sorter-class-name>
Modified: jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-24 16:41:35 UTC (rev 3544)
@@ -6,6 +6,8 @@
<hibernate-mapping>
+ <typedef name="text" class="org.jbpm.db.hibernate.TextType" />
+
<!-- related to ProcessDefintion -->
<!-- ########################### -->
Modified: jbpm3/branches/aguizar/modules/enterprise/pom.xml
===================================================================
--- jbpm3/branches/aguizar/modules/enterprise/pom.xml 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/modules/enterprise/pom.xml 2008-12-24 16:41:35 UTC (rev 3544)
@@ -337,9 +337,6 @@
<excludes>
<!-- [JBPM-1818] Use Sybase instance that supports XA Transaction -->
<exclude>org/jbpm/enterprise/deployment/DeploymentPARTest.java</exclude>
- <exclude>org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java</exclude>
- <exclude>org/jbpm/enterprise/jta/JtaDbPersistenceTest.java</exclude>
- <exclude>org/jbpm/enterprise/jms/JmsMessageTest.java</exclude>
</excludes>
</configuration>
</plugin>
Modified: jbpm3/branches/aguizar/pom.xml
===================================================================
--- jbpm3/branches/aguizar/pom.xml 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/pom.xml 2008-12-24 16:41:35 UTC (rev 3544)
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
- <!-- ====================================================================== -->
- <!-- -->
- <!-- JBoss, the OpenSource J2EE webOS -->
- <!-- -->
- <!-- Distributable under LGPL license. -->
- <!-- See terms of license at http://www.gnu.org. -->
- <!-- -->
- <!-- ====================================================================== -->
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
- <!-- $Id: pom.xml 7412 2008-06-06 13:42:30Z thomas.diesler at jboss.com $ -->
+<!-- $Id: pom.xml 7412 2008-06-06 13:42:30Z thomas.diesler at jboss.com $ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>JBoss jBPM3</name>
@@ -28,11 +28,12 @@
<!-- Modules -->
<modules>
<module>modules/core</module>
- <module>modules/identity</module>
+ <module>modules/distribution</module>
<module>modules/enterprise</module>
<module>modules/examples</module>
+ <module>modules/identity</module>
+ <module>modules/integration</module>
<module>modules/simulation</module>
- <module>modules/integration</module>
<!-- Execute as part of -Pdistro
<module>modules/db</module>
@@ -611,11 +612,18 @@
</activation>
<dependencies>
<dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
+ <groupId>com.sybase</groupId>
+ <artifactId>jconnect</artifactId>
+ <version>6.0.5</version>
<scope>test</scope>
</dependency>
</dependencies>
+ <repositories>
+ <repository>
+ <id>qa.jboss.com</id>
+ <url>http://www.qa.jboss.com/jdbc-drivers/maven2</url>
+ </repository>
+ </repositories>
</profile>
<!-- -Ddatabase=oracle -->
Modified: jbpm3/branches/aguizar/profiles.xml.example
===================================================================
--- jbpm3/branches/aguizar/profiles.xml.example 2008-12-24 16:25:03 UTC (rev 3543)
+++ jbpm3/branches/aguizar/profiles.xml.example 2008-12-24 16:41:35 UTC (rev 3544)
@@ -16,24 +16,24 @@
<jboss500.home>/home/tdiesler/svn/jbossas/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA</jboss500.home>
<!--
- <jdbc.mysql.url>jdbc:mysql://localhost:3306/jbpmtest</jdbc.mysql.url>
<jdbc.mysql.server>localhost</jdbc.mysql.server>
<jdbc.mysql.port>3306</jdbc.mysql.port>
<jdbc.mysql.database>jbpmtest</jdbc.mysql.database>
+ <jdbc.mysql.url>jdbc:mysql://${jdbc.mysql.server}:${jdbc.mysql.port}/${jdbc.mysql.database}</jdbc.mysql.url>
<jdbc.mysql.username>jbpmtest</jdbc.mysql.username>
<jdbc.mysql.password></jdbc.mysql.password>
- <jdbc.postgresql.url>jdbc:postgresql://localhost:5432/jbpmtest</jdbc.postgresql.url>
<jdbc.postgresql.server>localhost</jdbc.postgresql.server>
<jdbc.postgresql.port>5432</jdbc.postgresql.port>
<jdbc.postgresql.database>jbpmtest</jdbc.postgresql.database>
+ <jdbc.postgresql.url>jdbc:postgresql://${jdbc.postgresql.server}:${jdbc.postgresql.port}/${jdbc.postgresql.database}</jdbc.postgresql.url>
<jdbc.postgresql.username>jbpmtest</jdbc.postgresql.username>
<jdbc.postgresql.password></jdbc.postgresql.password>
- <jdbc.sybase.url>jdbc:jtds:sybase://localhost:5000/jbpmtest</jdbc.sybase.url>
<jdbc.sybase.server>localhost</jdbc.sybase.server>
<jdbc.sybase.port>5000</jdbc.sybase.port>
<jdbc.sybase.database>jbpmtest</jdbc.sybase.database>
+ <jdbc.sybase.url>jdbc:sybase:Tds:${jdbc.sybase.server}:${jdbc.sybase.port}/${jdbc.sybase.database}</jdbc.sybase.url>
<jdbc.sybase.username>jbpmtest</jdbc.sybase.username>
<jdbc.sybase.password>jbpmtest</jdbc.sybase.password>
-->
More information about the jbpm-commits
mailing list