• Post Reply Bookmark Topic Watch Topic
  • New Topic

EntityContext Vs. EJBObject

 
Mehul Sanghvi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
Can anybody please let me know as to what is the need for EntityContext and why cannot EJBObject reference be passed to the bean directly?
Thanks in advance!
Regards,
Mehul.
 
sabuj paul
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i believe the EntityContext is mainly responsible for connetion to the container while the EJBObject is for other purpose.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you describe how and why would you want to "pass a reference to the EJBObject to the bean directly"?
 
Mehul Sanghvi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys..
Thanks for you replies.!
Lasse Koskela :
Could you describe how and why would you want to "pass a reference to the EJBObject to the bean directly"?
Well.. my question is more of conceptual. What I wanted to know is why do we have EntityContext? I mean what purpose does it serve?
My understanding of EntityContext previously was : It is an object which is passed to EntityBean so that EntityBean can retrieve MetaData about EntityData as well as EntityObject and EntityHome.
The same thing can be acheived by the container by passing the reference of EntityObject instead of EntityContext...
I hope my question is not too vague.
Thanks again.
Regards,
Mehul.
 
Vinod John
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

what I wanted to know is why do we have EntityContext?

Entity context provides the bean class access to the context information, like the home, remote interfaces, transaction information, security settings etc, maintained by the Application server for that particular bean.
EJBObject (think that's what you mean by Entity Object) is nothing but a server side (extension) proxy to the bean. Each client will have its own proxy (EJBObject),this object has logic to marshal and unmarshal client request and delegate the client request to the bean.

The same thing can be acheived by the container by passing the reference of EntityObject instead of EntityContext...

Both these classes (EJBObject and EntityContext) are for two different purposes, one totally decouples the the client from the a bean and other is for decoupling the bean class for its metadata information ... so I don't think that do the same thing.
[ October 30, 2003: Message edited by: Vinod John ]
 
Ramakrishnan thiyagarajan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
Context is a n object that can be used to environment information about the ben. ie the current status of the bean(transaction,security roles).container can sets the context object.so we can pass a refernce to the bean that the way container knows the status of the bean instances.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!