• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts while through EJB 3.0 core spec.

 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • 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.
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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; }
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic