You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "alex mccarrier (JIRA)" <ib...@incubator.apache.org> on 2004/12/02 23:04:23 UTC

[jira] Created: (IBATIS-20) upgrading from old version defaults to wrong TransactionManager

upgrading from old version  defaults to wrong TransactionManager
----------------------------------------------------------------

         Key: IBATIS-20
         URL: http://nagoya.apache.org/jira/browse/IBATIS-20
     Project: iBatis for Java
        Type: Bug
 Environment: jboss 3.2.1, iBatis 2.0.8 (upgraded from iBatis 1.2.9)
    Reporter: alex mccarrier


We are using EJB to demarcate transactions.  Old iBatis sql config file contained this:

    <settings useGlobalTransactions="true"
              cacheModelsEnabled="true" />

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

Which configured iBatis to use external global transaction management, which from the documentation I understand this to be the default unless I specify to use Managed Global Transactions by including settings attribute called "userTransactionJndiName" (iBatis 1.2.9 manual, pp 39-40).

When iBatis 2.0.8 tries to do the conversion, it defaults to Managed Global Transactions, then throws a ClassCastException because it can't find a UserTransaction object at jndi name "" (because there is none specified).




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-20) upgrading from old version defaults to wrong TransactionManager

Posted by "alex mccarrier (JIRA)" <ib...@incubator.apache.org>.
     [ http://nagoya.apache.org/jira/browse/IBATIS-20?page=comments#action_56123 ]
     
alex mccarrier commented on IBATIS-20:
--------------------------------------

I think this is the source of the problem, in the compatibility libraries there is this XSL file:

com/ibatis/db/sqlmap/upgrade/SqlMapConfig.xsl

Which contains this template:

  <xsl:template match="datasource">
    <xsl:element name="transactionManager">
      <xsl:choose>
        <xsl:when test="//settings/@useGlobalTransactions='true'">
          <xsl:attribute name="type">JTA</xsl:attribute> <========================== this is wrong
          <xsl:element name="property">
            <xsl:attribute name="name">UserTransaction</xsl:attribute>
            <xsl:attribute name="value">
              <xsl:value-of select="//settings/@userTransactionJndiName"/>
            </xsl:attribute>
          </xsl:element>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="type">JDBC</xsl:attribute>
        </xsl:otherwise>

What this seems to be saying is that if useGlobalTransactions is 'true' then there will also be a userTransactionJndiName ... however, in the old format this is not always required, as in our case we are not using that sine we are not using User Managed Transactions.  I think what SHOULD be happening here is that there should be an option that says if userTransactionJndiName is "" then transactionManager/@type should be EXTERNAL.

> upgrading from old version  defaults to wrong TransactionManager
> ----------------------------------------------------------------
>
>          Key: IBATIS-20
>          URL: http://nagoya.apache.org/jira/browse/IBATIS-20
>      Project: iBatis for Java
>         Type: Bug
>  Environment: jboss 3.2.1, iBatis 2.0.8 (upgraded from iBatis 1.2.9)
>     Reporter: alex mccarrier

>
> We are using EJB to demarcate transactions.  Old iBatis sql config file contained this:
>     <settings useGlobalTransactions="true"
>               cacheModelsEnabled="true" />
>             <datasource name="snmDataSource"
> 	                factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory"
> 	                default="true" >
> 	                <property name="DBFullJndiContext" value="java:/DataSource" />
> 	    </datasource>
> Which configured iBatis to use external global transaction management, which from the documentation I understand this to be the default unless I specify to use Managed Global Transactions by including settings attribute called "userTransactionJndiName" (iBatis 1.2.9 manual, pp 39-40).
> When iBatis 2.0.8 tries to do the conversion, it defaults to Managed Global Transactions, then throws a ClassCastException because it can't find a UserTransaction object at jndi name "" (because there is none specified).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Updated: (IBATIS-20) upgrading from old version defaults to wrong TransactionManager

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-20?page=history ]

Clinton Begin updated IBATIS-20:
--------------------------------

    Priority: Minor  (was: Major)

I'm reducing the priority of this issue.  I'm guessing that we'll stop support for 1.x, as it's been over a year taht 2.0 has been out.  At the very least, all projects should convert to the new XML document format, even if you still use the 1.x API.  

> upgrading from old version  defaults to wrong TransactionManager
> ----------------------------------------------------------------
>
>          Key: IBATIS-20
>          URL: http://issues.apache.org/jira/browse/IBATIS-20
>      Project: iBatis for Java
>         Type: Bug
>  Environment: jboss 3.2.1, iBatis 2.0.8 (upgraded from iBatis 1.2.9)
>     Reporter: alex mccarrier
>     Priority: Minor

>
> We are using EJB to demarcate transactions.  Old iBatis sql config file contained this:
>     <settings useGlobalTransactions="true"
>               cacheModelsEnabled="true" />
>             <datasource name="snmDataSource"
> 	                factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory"
> 	                default="true" >
> 	                <property name="DBFullJndiContext" value="java:/DataSource" />
> 	    </datasource>
> Which configured iBatis to use external global transaction management, which from the documentation I understand this to be the default unless I specify to use Managed Global Transactions by including settings attribute called "userTransactionJndiName" (iBatis 1.2.9 manual, pp 39-40).
> When iBatis 2.0.8 tries to do the conversion, it defaults to Managed Global Transactions, then throws a ClassCastException because it can't find a UserTransaction object at jndi name "" (because there is none specified).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATIS-20) upgrading from old version defaults to wrong TransactionManager

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-20?page=history ]
     
Clinton Begin closed IBATIS-20:
-------------------------------

     Assign To: Clinton Begin
    Resolution: Won't Fix


Upgrading is a one shot deal.  This is such an isolated case and a low priority, I don't see it causing most people any trouble.  Everyone should be moving to 2.0, at least in terms of the XML files (i.e. use the 1.x Java API with 2.x files).  You can tweak the config file by hand after the conversion.

> upgrading from old version  defaults to wrong TransactionManager
> ----------------------------------------------------------------
>
>          Key: IBATIS-20
>          URL: http://issues.apache.org/jira/browse/IBATIS-20
>      Project: iBatis for Java
>         Type: Bug
>  Environment: jboss 3.2.1, iBatis 2.0.8 (upgraded from iBatis 1.2.9)
>     Reporter: alex mccarrier
>     Assignee: Clinton Begin
>     Priority: Minor

>
> We are using EJB to demarcate transactions.  Old iBatis sql config file contained this:
>     <settings useGlobalTransactions="true"
>               cacheModelsEnabled="true" />
>             <datasource name="snmDataSource"
> 	                factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory"
> 	                default="true" >
> 	                <property name="DBFullJndiContext" value="java:/DataSource" />
> 	    </datasource>
> Which configured iBatis to use external global transaction management, which from the documentation I understand this to be the default unless I specify to use Managed Global Transactions by including settings attribute called "userTransactionJndiName" (iBatis 1.2.9 manual, pp 39-40).
> When iBatis 2.0.8 tries to do the conversion, it defaults to Managed Global Transactions, then throws a ClassCastException because it can't find a UserTransaction object at jndi name "" (because there is none specified).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira