• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XATransaction Problem with EJB3.0, Derby DS and JMS

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic