aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes XATransaction Problem with EJB3.0, Derby DS and JMS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "XATransaction Problem with EJB3.0, Derby DS and JMS" Watch "XATransaction Problem with EJB3.0, Derby DS and JMS" New topic
Author

XATransaction Problem with EJB3.0, Derby DS and JMS

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
Hi,

I have a stateless session bean with one method that is inserting row in db using entitybean and then sending message on queue.
I am using XADatasource and XAConnectionFactory for db and message respectively.

Now when my database insertion fails, I expect transcation to roll back and message should NOT be sent to queue, but its happening otherwise, i.e exception is thrown but message is also sent to Q.

following is my code and environment details



Environment Details

APPServer :- jboss-5.1.0.GA
Database db-derby-10.4.2.0-bin.

DS settings



Any Pointer?


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10288
    
169

QueueSession qSession = qConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);


As per the javadoc of that method, the first parameter is for deciding whether the session is transacted. So try sending true:



[My Blog] [JavaRanch Journal]
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641
yeha i did try that too but same result, both the sucess and failure messages are read by the listener.



and i do get following warning after messages are consumed..

14:57:04,982 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] Could not find new XAResource to use for recovering non-serializable XAResource < 131075, 28, 26, 49454551102535510210299565855569858521005297515554985852485445511025355102102995658555698585210052975155549858524855 >
14:57:04,997 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.noresource] [com.arjuna.ats.internal.jta.resources.arjunacore.noresource] No XAResource to recover < 131075, 28, 26, 49454551102535510210299565855569858521005297515554985852485445511025355102102995658555698585210052975155549858524855 >

-Praful
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XATransaction Problem with EJB3.0, Derby DS and JMS