• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Entity Object Identity

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all:
Page 108 of the spec says the following:

Each entity object has an identity which, in general, survives a crash and restart of the container in
which the entity object has been created. The object identity is implemented by the container with the
cooperation of the enterprise bean class.


What is meant by the entity object? Is this the bean? What do they mean by surviving a crash? Does that mean when the container is restarted the entity object will be re-created? What is meant by the object identity?
Please provide an other information that may help clear up my confusion.
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,
In the sentence "Each entity object has an identity which, in general, survives a crash and restart of the container in which the entity object has been created.", what should survive a crash is the bean's *identity* (the row in the DB), not the bean itself.
Cheers,
Phil.
[ December 13, 2003: Message edited by: Philippe Maquet ]
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Keith,

Originally posted by Keith Rosenfield:
Hello all:
Page 108 of the spec says the following:

What is meant by the entity object? Is this the bean? What do they mean by surviving a crash? Does that mean when the container is restarted the entity object will be re-created? What is meant by the object identity?
Please provide an other information that may help clear up my confusion.


As far as i understand, Entity object and Bean is different thing. As explained in HF, Entity Object (after compeletion of constructor) becomes Bean( with its beanness) after the setSessionContext() and ejbCreate() methods are done with their execution.
Surviving a crash means - if the server crashes, the bean, ie OO view of respresenting a row in a table in a database, must be able to be saved in the table. And when the server is back up on, the client should be able to retrive that row through the bean again.
As far as the Object identity is concerned, i believe it's the primary key that bean has which is essentially represents a unique row in a table in the database.
someone might want to get in here and correct if what i just mentioned are wrong.
thanks.
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Phillipe and Natashe:
I'm still a bit confused on the subject. I'm really not sure what questions to ask at this point. I suppose as I continue with my studies it will become clearer.
[ December 13, 2003: Message edited by: Keith Rosenfield ]
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 41 section 5.1 of the spec starts:

For a client, a session object is a non-persistent object that implements some business logic running on
the server; an entity bean is a component that represents an object-oriented view of some entities stored
in a persistent storage, such as a database, or entities that are implemented by an existing enterprise
application.


This paragraph refers to something called "a session object".

The spec continues with the following paragraph:

A client accesses a session bean or an entity bean through the bean�s home and component interfaces.
The home and component interfaces of the bean provide the client view. The container provides classes
that implement the enterprise bean�s home and component interfaces. Although the client view of the
deployed enterprise bean is provided by classes implemented by the container, the container itself is
transparent to the client.


This paragraph refers to something called "a session bean".

It seems to me that the session object that the first paragraph is refering to is the same thing a the session bean that the second paragraph. Am I correct in my understanding? If they don't refer to the same thing, then how are they different?
 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keith,
Yes, the session in the both paragraph refers to the same session bean. But i didn't find these paragraphs in page 41 though. The page 41 in spec starts with the Chapter 4.
namaste
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops.. I meant page 51.
 
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic