i have read that the container synchronizes the bean with the underlying storage by calling the bean's ejbLoad() and ejbStore(), to ensure the clients that the data they access and process in the business method, is not stale.
this is the sequence ejbLoad()-business method-ejbStore(). let's have a two-client-scenario where we have two entity bean instances.
bold ones are methods used by first client.
second client comes in to the picture, while the data is still being processed by the first client
first client stores the data in to db
won't the data the second client is about to process goes stale? How the container solves the problem? or is this a problem at all?
thank you amit, my question has been addressed in that article, but not solved. the author has mentioned that this is the only issue we face when employing 'database concurrency' and a solution is yet to be found.
Amit M Tank
Joined: Mar 28, 2004
Yes the data gets stale but when you are trying to do a commit the container can check for the data to be stale(may be by calling load again) and throw an EJBException(concurrency exception) if you have configured database concurrency strategy in your server. We used this for EJB2.x with weblogic. I am not sure if other servers provides similar mechanism.