aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFE - Bean things you can do - Not explained Well - Can anybody help? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFE - Bean things you can do - Not explained Well - Can anybody help?" Watch "HFE - Bean things you can do - Not explained Well - Can anybody help?" New topic
Author

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

mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
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

Joined: May 29, 2004
Posts: 26
I think the page number in your posting is incorrect. It does not mention ejbCreate/Remove/Activate or Passivate methods.
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
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

Joined: Aug 10, 2002
Posts: 360
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)


Siva
Co-Author - SCMAD Exam Guide - ISBN:9780070077881
Author - Java certification success, Part 4: SCEA
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
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

Joined: May 29, 2004
Posts: 26
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

Joined: May 06, 2004
Posts: 68
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 ]

Suman A Sarker<br />SCJP, SCWCD, SCBCD<br /> <br />If You Can't Beat Them ... Join Them!
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
Thanks Suman.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFE - Bean things you can do - Not explained Well - Can anybody help?