JBoss Community

jBPM 4.4 on sybase

reply from Alejandro Guizar in jBPM - View the full discussion

Dino, this is an issue with the JConnect driver. Even though jBPM 4.4 is not tested with Sybase,  jBPM 3.2 is, and I recognized the issue instantly. The problem is described in the heading comment of this source file:

work around a "feature" in the jConnect driver when setting a text parameter to null.
Specifically, the call:

PreparedStatement st;
st.setNull(index, Types.CLOB);

throws an SQLException with SQL state "JZ0SL" and reason "Unsupported SQL type".

Unfortunately the workaround is not straightforward. On the one hand you can switch to jTDS, unfortunately it does not support XA transactions for Sybase. If that is not a problem for you, go ahead and try that driver. Otherwise, you can try the jBPM3 solution. Add SybaseTextType.java to your application. Next, create a Hibernate mapping file with the following content.

 

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
      -//Hibernate/Hibernate Mapping DTD 3.0//EN
      http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd>
<hibernate-mapping>
  <typedef name="text" class="org.jbpm.db.hibernate.SybaseTextType" />
</hibernate-mapping>

This will make any field/property mapped to a text column employ the SybaseTextType instead of the standard org.hibernate.type.TextType, thus avoiding the call that breaks jConnect. This solution will eventually make it to jBPM4 but in the meantime, please apply it yourself.

Reply to this message by going to Community

Start a new discussion in jBPM at Community