• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stateful Session bean - Meaningful Tx context

 
vikas jain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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 ]
 
Balaji VR
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hmm.....Makes sense!
 
vikas jain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic