Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFE - Bean things you can do - Not explained Well - Can anybody help?

 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have been pulling my hair while studying HFE book for "Bean things you can do " in a callback methods.

It is so confusing and I am sorry to say, not explained well.

Say for example, can anybody please explain (Page 347, why ejbActivate(), ejbPassivate and ejbRemove() methods in stateful session bean can get a transaction reference and call methods on it, but cannot do a CMT realted things.

Mini
 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the page number in your posting is incorrect. It does not mention ejbCreate/Remove/Activate or Passivate methods.
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Karthik Siva:
I think the page number in your posting is incorrect. It does not mention ejbCreate/Remove/Activate or Passivate methods.


Thanks Karthik, never mind it is well explained and classified in EJB specs.
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be if you can provide the correct page number and mention the section which was not explained well, the authors can change it in the next edition(if it's valid)
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is page no 216, which also refers to others pages 199 and 207. Well it doesn't say anything about the obivious question one gets in their mind, looking at the valid bean things described in these pages.

According to spec

1. "Invoking the getRollbackOnly and SetRollbackOnly methods is disallowed if the session bean methods for which the container does not have a meaningful transaction context, and to all session beans with bean-managed transaction demaraction"

2. 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.


Now if you look at ejbCreate, ejbRemove, ejbPassivate or ejbActivate of a stateful session bean in the above mention pages of HFE, it appears that they all don't allow SetRollbackOnly or getRollbackOnly but allow access to resources and other beans.

If the above is due to "not having meaningful transaction context" then it should not allow access to resource manager according to 2 point from the spec.

Well I just think HFE could have explained this. It really gets confusing.

Thanks
 
Kaarthik Sivashanmugam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This part is confusing for me too. May be if you understood, you can explain to me as why there has to be a meaningful transaction context to access resource manager and other beans.

Thanks.
 
Suman Sarker
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mini,
Almost similar type of discussion was going on a few days ago in this forum. Our fellow rancher Roger pointed out that the spec should have said this


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


instead of saying

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.


Check out the discussion here

Regards
Suman
[ June 09, 2004: Message edited by: Suman Sarker ]
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Suman.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic