• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entity Bean Lifecycle.

 
Vishal Saxena
Greenhorn
Posts: 26
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A client sets a field on an entity bean; when is it ejbStore()d ? - when pooled, or before activating for another primary key.
Adding to the Qtn, two clients are viewing the same data, through two different entity beans; if the ejbStore() is not immediately after setting of the field then it may be so that finally the data after their individual sets may not be the one that was last set.
[ April 27, 2003: Message edited by: Vishal Saxena ]
 
Geeta Ramasami
Ranch Hand
Posts: 72
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As soon as the business methods processing gets over,ejbStore() gets called.And also entity bean instance is multi threaded.So 2 clients going to access the same row in a table can share the same entity instance pointing to the row.
The point of inconsistancy won't be there as the container takes care of it.When one client access it,other client will be made to wait as the bean instance is synchronised by the container.
Geeta
 
Ajith Kallambella
Sheriff
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.When one client access it, other client will be made to wait as the bean instance is synchronised by the container.
Geeta[/QB]

Just to add my two cents worth, how methods on the bean instances get serialized, and hence how concurrent reads and writes are handled is controlled by transaction isolation levels.
 
william kane
Ranch Hand
Posts: 260
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Geeta Ramasami:

As soon as the business methods processing gets over,ejbStore() gets called.And also entity bean instance is multi threaded..
Geeta

How can the entity bean instance be multithreaded?When the specification prevents you from doing so.I thought bean instances are pooled and load and store are called based on the need by the container to refresh the states of the bean instances that represent the same data.I fell queing up requests as Geeta suggested will cause a performance bottleneck.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic