• 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 Bean Lifecycle.

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic