• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Doubts while through EJB 3.0 core spec.

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

Please help me understand below :

1) Section 4.3.3: what is te difference b/w getInvokedBusinessInterface and getBusinessObject methods ?

2) Section 4.4.2 :

Invoking the getEJBObject and getEJBLocalObject methods is disallowed in the session bean methods in which there is no session object identity established for the instance.



Above , what it means by session object identity established for instance ? ( Is it talking abt annotation or declaring in DD that this bean is session bean using stateful or stateless ) .


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

Doubt (1) is okay now as i got very nice old threads : old thread one and old thread two

Please help me with Doubt (2) .


Thanks
Vishal Chugh
 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know exactly. I think those methods are disallowed when the session bean object is created explicitly, rather than by the container.
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vishal,

I understand the statement

Invoking the getEJBObject and getEJBLocalObject methods is disallowed in the session bean methods in which there is no session object identity established for the instance.


as follows:

Session object identity is some kind of object identity that is assigned by the container when an instance of the session bean is created. (see core spec 3.4.5).

Since getEJBObject() returns a reference on the current bean instance (it's the getBusinessObject()'s equivalent for ejb2 beans) this method should not be invoked until the bean instance is created. Therefore in the bean's lifecycle, the first method where getEJBObject() can be called is the post construct method. Same for getEJBLocalOBject().


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

Thank you!!!

But what can be the case , when no object identity will be assosiated with instance of session bean by the container ? I mean what case they are talking about ?


Thanks
Vishal Chugh
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This concerns constructors, setSessionContext() from SessionBean interface and methods used for dependency injection, like

@PersistenceContext
private void setEntityManager(EntitManager em){ entityManager = em; }
 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vishal Chugh wrote:Hi Ralph,

Thank you!!!

But what can be the case , when no object identity will be assosiated with instance of session bean by the container ? I mean what case they are talking about ?


Thanks
Vishal Chugh



i doubt this might be a case, when the session bean instance is being destroyed, then calls are made for getEJBObject.
 
Don't play dumb with me! But you can try this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic