This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubt on Entity Beans

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I was going through "Entity Beans are Persistent" chapter in HF EJB and found this following doubt.
In the page 281, i read, "ejbCreate () will be called on beans in the pool. Container does not make a new entity bean"
I couldnt understand above sentence. Can anybody explain how it works?

Thanks and Regards,
 
Ranch Hand
Posts: 123
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It means ejbCreate is called on the bean instances which are in pooled state. Entity beans lifecycle is different from other beans.

It like new instance --> setEntityContontext --> pooled state --> ejbCreate
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gowda
When the client want to insert an entity into persistant storage,(database) it calls create(..) which in turns container pulls the bean instance (which just holds the entity context) and passes the arg provided by the client in create method by calling ejbCreate(..)on the bean instance in this method the bean provider assign the value to the persistant feild of the bean which makes the primary key and then it insert the entity and assign this primary key to the EntityContext & EJBObject and now this entity bean instance represent the the inserted entity in database.
Hope it clears your doubt..
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
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
    Bookmark Topic Watch Topic
  • New Topic