You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "McCarrier, Alex" <am...@pointserve.com> on 2004/12/02 22:12:14 UTC

Problems upgrading from 1.2.x to 2.0.8

I'm getting ClassCastExceptions on TransactionManager when trying to
load our old ibatis config file using the new iBatis libraries.  

Apparently what it is trying to do is an on the fly conversion from the
old format to the new format (found by tracing through iBatis source
code).  However, we don't have anything transaction related in our
config file other than a settings option to specify using global
transactions.  We let the EJB container handle the demarcation of our
transactions.  When iBatis does the conversion, it seems to default to
using JTA transactions, tries to lookup the UserTransaction with JNDI
name "" and then throws the ClassCastException.  Any ideas on how to fix
this without having to do a manual conversion of the file (although I
will do that if that's the only way, but someone might want to add this
to the upgrade guide).

Here's the part of our config file that is causing problems:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sql-map-config
    PUBLIC "-//iBATIS.com//DTD SQL Map Config 1.0//EN"
    "http://www.ibatis.com/dtd/sql-map-config.dtd">

<sql-map-config>

    <settings useGlobalTransactions="true"
              cacheModelsEnabled="true" />
    <!--settings useBeansMetaClasses="true"/ Investigate, suppose to be
big performance improvement-->

    <datasource name="snmDataSource"
	
factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory"
	          default="true" >
        <property name="DBFullJndiContext" value="java:/dsname" />
    </datasource>

	.. Rest of stuff here ...
    
</sql-map-config>