This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doubt about EJBContext.setRollbackOnly in Statefull session beans?  RSS feed

 
Rafael Rocha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in question below:
Which of the following statements are correct regarding EJBContext.setRollbackOnly() method?
---

i have marked an alternative with argument below, that is false:
It can be used by stateful session beans with bean managed transactions.
---

response correct this question:
It cannot be used by JPA Entities.
---

ok. i accept correct question, but i don't understand my incorrect alternative. help-me?
 
krishna bulusu
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can call EJBContext.setRollbackOnly() in BMT.
You can only call it in CMT with the following Transaction Attributes:
Required, Require_new, Manadatory.
In BMT, You can use UserTransaction.setRollbackOnly().
Please correct me if I am wrong.
 
Rafael Rocha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krishna bulusu:
I don't think you can call EJBContext.setRollbackOnly() in BMT.Please correct me if I am wrong.
yes. i`m forget that detail. CMT can call EJBContext.setRollbackOnly() and don't BMT.

exist one higher conversation for this topic that discuss same doubt. but i clarify this situation with information this topics below:

When to use UserTransaction's setRollbackOnly() and UserTransaction's rollback()
questions about setRollbackOnly() for BMT

thanks a lot! :^)
[ July 20, 2008: Message edited by: Rafael Rocha ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!