Illegal conversion on any VARCHAR FOR BIT DATA column in a CMP bean
 Technote (troubleshooting)
 
Problem(Abstract)
Part of exception stack,

com.ibm.ws.ejbpersistence.utilpm.PersistenceManagerException: PMGR6022E:
---- Begin backtrace for nested exception
com.ibm.db2.jcc.c.SqlException: Illegal Conversion
at com.ibm.db2.jcc.c.n.a(n.java:1040)
at com.ibm.db2.jcc.c.n.a(n.java:1118)
at com.ibm.db2.jcc.c.cm.a(cm.java:884)
at com.ibm.db2.jcc.c.cm.Q(cm.java(Inlined Compiled Code))
at com.ibm.db2.jcc.c.cm.c(cm.java(Compiled Code))
at com.ibm.db2.jcc.c.cm.c(cm.java(Compiled Code))
at com.ibm.db2.jcc.c.cm.C(cm.java:328)
at com.ibm.db2.jcc.c.cm.executeUpdate(cm.java:311)
 
Cause
When deploying enterprise beans with Container managed persistence (CMP), types that have any VARCHAR FOR BIT DATA columns defined on a DB2® table with the beans using the DB2 Universal JDBC™ type 4 driver to persist the data, an SQLException of Illegal Conversion is thrown at runtime.

This exception occurs only when you use the DB2 Universal JDBC type 4 driver and with the deferPrepares property set to true. When the deferPrepares property is set to true, the DB2 Universal JDBC type 4 driver uses the standard JDBC data mapping. Currently, the deploy
tool does not follow the standard JDBC specification mapping, which causes the Illegal conversion exception.
 
Resolving the problem

Workaround:

Do not use the DB2 Universal JDBC type 4 driver if your table has any VARCHAR FOR BIT DATA or LONG VARCHAR FOR BIT DATA columns. Use the DB2 legacy CLI-based JDBC driver to persist the data.

Set the deferPrepares property to false in the data source configuration data.

Note: If you set the deferPrepares property to true in a later release, your application might experience different database behavior.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Windows
Software version: 5.0.2.5
Software edition:
Reference #: 1168955
IBM Group: Software Group
Modified date: May 13, 2004