• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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?

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!