ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Problems upgrading from 1.2.x to 2.0.8
Date Fri, 03 Dec 2004 15:03:55 GMT
I'd really recommend converting your SQL Maps (just the XML) to the
2.0 syntax.  You can continue to safely use the 1.x java API, but the
2.0 XML is much cleaner and will avoid these conversion issues for
complex configurations.


On Thu, 2 Dec 2004 17:06:29 -0600, McCarrier, Alex
<amccarrier@pointserve.com> wrote:
> FYI I found the cause of this:
> There is an XSL transform in the ibatis-sqlmap-1-x.jar upgrade that does
> an on the fly conversion when using the old format config files.  When
> it encounters useGlobalTransactions in the settings it assumes the user
> is using User Managed Transactions and tries to get the JNDI names from
> the settings as well.  However, when useGlobalTransactions is set in the
> old it does not necessarily mean they are using user managed
> transactions, by default it means they are using external transactions.
> The XSL incorrectly translates the file to JTA with JNDI name "".  It
> should translate to transaction type EXTERNAL.
> -----Original Message-----
> From: McCarrier, Alex [mailto:amccarrier@pointserve.com]
> Sent: Thursday, December 02, 2004 3:12 PM
> To: ibatis-user-java@incubator.apache.org
> Subject: 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>

View raw message