Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XATransaction Problem with EJB3.0, Derby DS and JMS

 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

 
Praful Thakare
Ranch Hand
Posts: 642
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic