File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setRollbackOnly not working

 
Roshan Lal
Ranch Hand
Posts: 64
  • 0
  • 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
 
Chris Mathews
Ranch Hand
Posts: 2712
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using a TXDatasource?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic