Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

EntityContext Vs. EJBObject

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i believe the EntityContext is mainly responsible for connetion to the container while the EJBObject is for other purpose.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic