This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

setRollBackOnly

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setRollBackOnly is defined in two interfaces UserTx and EjbContext, i guess.

so what is the reason for following 2 things to be true ?

1) A BMT Stateful bean can call ut.setRollBackOnly in ejbCreate() method.
2)A steless session bean can not call sc.setRollbackonly in setSeesionContext() method.
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

1)Opinion for (1) Question:-
Spec says:

An enterprise bean with bean-managed transaction demarcation must not use the getRollbackOnly() and setRollbackOnly() methods of the EJBContext interface.

An enterprise bean with bean-managed transaction demarcation has no need to use these methods,
because of the following reasons:
� An enterprise bean with bean-managed transaction demarcation can obtain the status of a transaction by using the getStatus() method of the javax.transaction.UserTransaction interface.
� An enterprise bean with bean-managed transaction demarcation can rollback a transaction using the rollback() method of the UserTransaction interface.

I think its like we are not supposed to interfere with the working of container.When we say we are going for BMT then we must pretty much adhere to it.

(2)Opinion for Question(2)

Stateless Session bean's creation and removal is tied to the container, so there may be an unspecified transaction context running during stateless session bean creation and context settings.
This may be the reason why we cannot call setRollbackOnly() on the SessionContext object.

Expect Corrections from all... :roll:

Regards,
Sagar.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic