• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stateful Session bean - Meaningful Tx context

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a doubt about stateful session bean tx context.

In the spec on page 81, it says -


� Invoking the getRollbackOnly and setRollbackOnly methods is disallowed in the session bean methods for which the Container does not have a meaningful transaction context,and to all session beans with bean-managed transaction demarcation.
� Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the Container does not have a meaningful transaction context or client security context.



and on page 80 ( Table for bean methods )

For CMT stateful bean and for ejbCreate,ejbRemove,ejbActivate,ejbPassivate methods, we can see setRollbackOnly and getRollbackOnly is not allowed. That means they run in unspecified tx context ( which by above quote is not a meaningful tx context).

Now also by above quote, we should not be allowed to aceess resource managers and enterprise beans. But the table says it is allowed. So isn't here some kind of contradiction?

Thanks,
Nikhil
[ May 25, 2006: Message edited by: Nikhil Agrawal ]
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Again, read this line

"...Accessing resource managers and enterprise beans is disallowed in the session bean methods for which the Container does not have a meaningful transaction context or client security context..."

"..........or client security context..." <---Are you getting it now???

Accessing resource managers and enterprise beans is ALLOWED IF IT HAS CLIENT SECURITY CONTEXT :-)

In CMT, Stateful session bean, for ejbCreate, ejbRemove, ejbActivate, ejbPassivate methods, they have CLIENT SECURITY CONTEXT

Hence the case

Happy Learning!
 
vikas jain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

But then what about the afterCompletion method of CMT stateful session bean. One can access the User identity information but is not allowed to access bean references and resource managers in that method?

Thanks.
 
Balaji VR
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm.....Makes sense!
 
vikas jain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah...it's so confusing. I don't mind mugging them up. But I just want to make sure that's the only way to do this and I am not missing some point here.
 
I am a man of mystery. Mostly because of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic