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

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic