File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Entity Bean Lifecycle. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Entity Bean Lifecycle." Watch "Entity Bean Lifecycle." New topic
Author

Entity Bean Lifecycle.

Vishal Saxena
Greenhorn

Joined: Apr 23, 2003
Posts: 26
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 ]

Thx -V
Geeta Ramasami
Ranch Hand

Joined: Mar 05, 2003
Posts: 72
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

Joined: Mar 17, 2000
Posts: 5782
.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.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
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.


Help me!Help you!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Entity Bean Lifecycle.