• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rollback in stateless session bean with out exception.

 
Suresh Penumetch
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using stateless session bean facades with transaction type - container and transaction attribute "required" for all methods.
In on case, I want to roll back the transaction based on a flag in the business logic. I won't be throwing/ catching any exception in this case. I just have to roll back all the updated done till now and return the flag to the client.
How can I roll back the transaction in this senario. Explicitily calling SessionContext().setRollbackOnly() is not working.
thanks in advance
 
Suresh Penumetch
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got the solution myself. By oversight I was using a raw connection to the database, due to which context.setRollbackonly was not working. It worked fine when used the properly configured data source for websphere app server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!