View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820234#3820234

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3820234

JBoss 3.2.1 & Oracle 9i



I am using the following code to get an instance of my TransactionManager and then to 
obtain the status of my current transaction.  I then plan to use the status to 
determine if I am already in a transaction (and therefore want to get the XA 
DataSource) or if I am not currently in an active transaction (and therefore want to 
get the non-XA DataSource).  The problem is that the getStatus() method is ALWAYS 
returning Status.STATUS_ACTIVE.



txMgr = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");

int txStatus = txMgr.getStatus();

if (txStatus == Status.STATUS_ACTIVE)

    ds = (DataSource) ctx.lookup("java:/XA-DS");

else

    ds = (DataSource) ctx.lookup("java:/NONXA-DS");



Like I mentioned above, the XA datasource is always returned, even when I'm not in a 
transaction.  So of course I get exceptions a few steps later like this...



[TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo

rmatId=257, GlobalId=SHASKINSLT//25, BranchQual=] errorCode=XAER_PROTO



and



[TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo

rmatId=257, GlobalId=SHASKINSLT//25, BranchQual=] errorCode=XAER_PROTO



and



[TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo

rmatId=257, GlobalId=SHASKINSLT//25, BranchQual=] errorCode=XAER_RMERR



Am I getting my TxMgr the wrong way?  Is my approach fundamentally flawed?  Any advice 
is greatly appreciated.


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to