• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

setRollbackOnly not working  RSS feed

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Are you using a TXDatasource?
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!