• Post Reply Bookmark Topic Watch Topic
  • New Topic

jms:Transaction Context  RSS feed

 
Karthika Kannan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using JMS and I would like to know when I can use setRollbackOnly().When I use it to rollback transactions when there is an exception,i get the following error message:
java.lang.IllegalStateException: setRollbackOnly can not be called without a Transaction Context

If somebody knows a solution to this,please help me out.
 
Mike Henry
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in your ejb-jar

Make sure that you.
1. You are using Container managed transaction

2. You the set the transaction attribute to "Required"

Then you can use the setRollBack.


if not you can

1. Use bean managed Transaction

2. and use the UserTransaction interface to do the same thing

Hope this helps

Mike H
 
Karthika Kannan
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Mike.
It works.

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