• 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

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

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Suman.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic