This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

setRollbackOnly not working

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a stateless session bean. In that one method calls two other methods of this bean. In those two methods they do call local entity beans for insert.
In the second call's catch block I have set ctx.setRollbackOnly().My second call to throws an exception.
I was expecting since the second call to entity bean threw an exception, and I marked the transaction to rollback, the entire transaction will rollback.
All the methods have been marked with "Required" attribute.
I am using weblogic 6.1.
Please help
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using a TXDatasource?
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, this is more of a WebLogic specific issue then a general J2EE question, as far as I can see, and should probably be moved to the WebLogic Forum.
 
Roshan Lal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for reply Chris. No , I am not using TxDatasource. I am using Datasource. Would it matter if only single database is involved because I thought TxDatasource is for 2PC?
Also , I have printed the transaction id
(using weblogic.transaction.TxHelper.getTransaction().getXID())in stateless session bean method and the entity bean methods. All methods print the same xid.

Originally posted by Chris Mathews:
Are you using a TXDatasource?


[ January 24, 2003: Message edited by: Roshan Lal ]
 
Roshan Lal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Chris. I tried TXDatasource and it works! I will read more on TXDatasource now...

Originally posted by Chris Mathews:
Are you using a TXDatasource?

 
I got this tall by not having enough crisco in my diet as a kid. This ad looks like it had plenty of shortening:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic