What happens to chaching when a application directly interacts with the database rather than going through EJBs.
Looks like the chached data would be stale.
If an application directly makes updates to the DB, is there any way that the container detects this and rereads the data from the DB to prevent stale data from being used.
Ajay Amrite
-
EJB Caching issue (3 messages)
- Posted by: Ajay Amrite
- Posted on: August 28 2000 11:03 EDT
Threaded Messages (3)
- EJB Caching issue by Mayank Nain on August 28 2000 12:01 EDT
- EJB Caching issue by Uday Kumar on August 28 2000 16:57 EDT
- EJB Caching issue by Staurt Batchelor on September 13 2000 08:23 EDT
-
EJB Caching issue[ Go to top ]
- Posted by: Mayank Nain
- Posted on: August 28 2000 12:01 EDT
- in response to Ajay Amrite
EJBLoad is the callback method which is called after "read-time-out-period" for Entity Beans. In EJBLoad you need to make sure for BMP's that the data your bean represent is not stale..
Mayank -
EJB Caching issue[ Go to top ]
- Posted by: Uday Kumar
- Posted on: August 28 2000 16:57 EDT
- in response to Ajay Amrite
hello Amrite,
If the Application is directly interacting with the Database there is little that the Container can do. If you are using BMP and directly interacting with the DB, then you can use an extra column in your database table for a timestamp and then make sure that whenever you do an update to the Database that the timestamp that you have is the same as the timestamp value in the table. That is one of the ways in which you can avoid stale data causing problems in db updates. Actually this is a part of the Optimistic Locking strategy. I would refer you to an article titled 'CMP Performance problems explained' in the Home Section of this portal for further information on caching and stale data problems.
Thanks
-U -
EJB Caching issue[ Go to top ]
- Posted by: Staurt Batchelor
- Posted on: September 13 2000 08:23 EDT
- in response to Uday Kumar
Hello Uday
I've also been considering how best to implement database synchronisation.
The timestamp method may be best for my application, polling the database for changes is expensive and doesn't fully solve the problem.
That article you recommended titled 'CMP Performance problems explained' sounds very useful but is no longer on the home page or in resources, have I missed it or is it gone?
Regards
Stuart.