Hi Patrick,

Thanks again for your reply regarding the XAException.

The problem seems to be solved when we used the JDBC Thick driver instead of
Thin driver (there should not be any difference between these 2 drivers
except the implementation). I was really keen in using Thin driver since it
is portable, but looks like there is an issue / bug in the Thin driver we
were using.

Thanks anyway,
Cheers,
Kari...

-----Original Message-----
From: Patrick van Kann [mailto:[EMAIL PROTECTED]
Sent: 21 May 2003 18:13
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Tyrex with Castor on Tomcat !


Hi all,

Apologies for not replying sooner!

I didn't reply because I can't shed any light on the exception - 
however, I successfully use Tyrex to manage transactions in Tomcat 
4.1.18. One key difference is that I am using Microsoft SQL Server 2000 
and Postgres in different applications, and not Oracle.

Perhaps it is an issue with the Oracle XADatasource?

Because AFAIK (Ned will correct me if I am wrong!!!) Postgres has no 
XADatasource (or at least one with 2PC enabled) I use Tyrex to fake my 
XADatasource thusly:

<domain>
    <name>tyrexDomain</name>
    <resources>
        <dataSource>
            <name>postgresqlDataSource</name>
            <jar>C:/jdbc/postgresql.jar</jar>
            <class>tyrex.resource.jdbc.xa.EnabledDataSource</class>
            <config>
                <driverClassName>org.postgresql.Driver</driverClassName>
                
<driverName>jdbc:postgresql://spoon.internal.fortune-cookie.com:5432/castor<
/driverName>
                <user>castor</user>
                <password>castor</password>
            </config>
            <limits>
                <maximum>50</maximum>
                <minimum>5</minimum>
                <initial>5</initial>
                <maxRetain>300</maxRetain>
                <timeout>10</timeout>
                <trace>true</trace>
            </limits>
        </dataSource>
    </resources>
</domain>

This just uses the vanilla Postgres JDBC driver. Perhaps you could do 
this to eliminate the Oracle XADatasource from your enquiries.

My other tip might be that you need to use Tyrex's TransactionManager to 
manage Castor via the setTransactionManager(String 
whereMyTransactionManagerIsInJNDI) method.

Because Tomcat doesn't expose the TransactionManager through JNDI 
normally, I created an ObjectFactory that works with Tomcat to do so.

Perhaps my document at 
http://castor-taglib.sourceforge.net/installing-tomcat4.1.8.html could 
help you set this up.

Cheers,

Patrick

Bruce Snyder wrote:

>This one time, at band camp, Karikalan Kumaresan said:
>
>KK>Has anyone used TYREX with CASTOR on Tomcat 4.1.18 and experienced the
>KK>following problems while getting the connection / Committing the
Transaction
>KK>?
>
>Karikalan,
>
>I know that Patrick van Kaan uses Tyrex with Tomcat. I'm CC'ing him on this
>reply because he might be able to help you out. 
>
>KK>javax.transaction.SystemException: javax.transaction.xa.XAException
>KK>    at tyrex.tm.impl.TransactionImpl.error(TransactionImpl.java:2837)
>KK>    at tyrex.tm.impl.TransactionImpl.xaError(TransactionImpl.java:2532)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.addNewResource(TransactionImpl.java:2727)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.enlistResource(TransactionImpl.java:669)
>KK>    at
>KK>tyrex.tm.impl.TransactionManagerImpl.enlistResource(TransactionManagerIm
pl.j
>KK>ava:368)
>KK>    at
>KK>tyrex.resource.jdbc.ConnectionPool.getConnection(ConnectionPool.java:417
)
>KK>    at
>KK>tyrex.resource.jdbc.ConnectionPool.getConnection(ConnectionPool.java:398
)
>KK>    at
>KK>org.exolab.castor.jdo.engine.DatabaseRegistry.createConnection(Unknown
>KK>Source)
>KK>    at
>KK>org.exolab.castor.jdo.engine.TransactionContextImpl.getConnection(Unknow
n
>KK>Source)
>KK>    at org.exolab.castor.persist.ClassMolder.load(Unknown Source)
>KK>    at org.exolab.castor.persist.LockEngine.load(Unknown Source)
>KK>    at org.exolab.castor.persist.TransactionContext.load(Unknown Source)
>KK>    at org.exolab.castor.persist.TransactionContext.load(Unknown Source)
>KK>    at org.exolab.castor.jdo.engine.DatabaseImpl.load(Unknown Source)
>KK>    at org.exolab.castor.jdo.engine.DatabaseImpl.load(Unknown Source)
>KK>    at
>KK>com.buildonline.docstar.persistence.castor.CastorJDOFacade.load(CastorJD
OFac
>KK>ade.java:157)
>KK>    at
>KK>com.buildonline.docstar.persistence.castor.CastorFolderDao.findById(Cast
orFo
>KK>lderDao.java:100)
>KK>
>KK>and
>KK>
>KK>tyrex.docstar_domain Thread-15 [ ERROR ] 2003-05-20 01:00:23,157 - Error
>KK>javax.transaction.xa.XAException[code -6 -
javax.transaction.xa.XAException]
>KK>reported in transaction xid:00e0ffce-40f9acd8e71b2185041024b7dcfd55b3
>KK>javax.transaction.xa.XAException
>KK>    at
>KK>oracle.jdbc.xa.OracleXAResource.disallowLocalTxnMode(OracleXAResource.ja
va:1
>KK>045)
>KK>    at
>KK>oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:153)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.addNewResource(TransactionImpl.java:2717)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.enlistResource(TransactionImpl.java:669)
>KK>    at
>KK>tyrex.tm.impl.TransactionManagerImpl.enlistResource(TransactionManagerIm
pl.j
>KK>ava:368)
>KK>    at
>KK>tyrex.resource.jdbc.ConnectionPool.getConnection(ConnectionPool.java:417
)
>KK>    at
>KK>tyrex.resource.jdbc.ConnectionPool.getConnection(ConnectionPool.java:398
)
>KK>    at
>KK>com.buildonline.common.persistence.connection.ConnectionManager.getConne
ctio
>KK>n(ConnectionManager.java:73)
>KK>
>KK>
>KK>and
>KK>
>KK>tyrex.docstar_domain Thread-4 [ ERROR ] 2003-05-20 00:55:18,849 - Error
>KK>javax.transaction.xa.XAException[code -3 -
javax.transaction.xa.XAException]
>KK>reported in transaction xid:00e0ffce-40f9acd8e71b2185041024b7d05f84b1
>KK>javax.transaction.xa.XAException
>KK>    at
>KK>oracle.jdbc.xa.OracleXAResource.allowGlobalTxnModeOnly(OracleXAResource.
java
>KK>:1069)
>KK>    at
>KK>oracle.jdbc.xa.OracleXAResource.suspendStacked(OracleXAResource.java:296
)
>KK>    at
>KK>oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:381)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.endForTransactionBoundary(TransactionImpl.
java
>KK>:2474)
>KK>    at
>KK>tyrex.tm.impl.TransactionImpl.internalRollback(TransactionImpl.java:1523
)
>KK>    at tyrex.tm.impl.TransactionImpl.commit(TransactionImpl.java:2254)
>KK>    at tyrex.tm.impl.TransactionImpl.commit(TransactionImpl.java:525)
>KK>    at
>KK>tyrex.tm.impl.TransactionManagerImpl.commit(TransactionManagerImpl.java:
157)
>KK>    at
>KK>tyrex.tm.impl.UserTransactionImpl.commit(UserTransactionImpl.java:109)
>KK>    at
>KK>com.buildonline.common.persistence.transaction.BolTransactionManager.end
Tran
>KK>saction(BolTransactionManager.java:228)
>KK>
>KK>It would be great if anyone can help me in this.
>
>Bruce
>  
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to