We are building a J2EE application.
We have several sets of data which live in a database and are only modified once in a while, but are accessed often. We would like to build a caching mechanism so that the data is returned from the cache rather than calling the database everytime.
The data in the database can be updated at any time. The data in the database will be updated via some external program (not through our application components). Therefore, we would need to have the database notify the cache when it has been updated, or build an interface to the cache to tell it that it is invalid.
Our application will run on iAS 6.0 in a clustered environment. A cache component would probably exist on every app server. (We would not want only one instance of the cache, for all app servers because then the network traffic and other overhead might defeat the purpose of a cache). So then, if we were to build a something to tell the cache to update itself, we would want to update all instances of the cache via one central mechanism.
Other details: the data we want to cache lives in DB2 running on an IBM mainframe (OS/390).Thoughts or comments on how to build?
Any previous experience here?
-
J2EE data caching mechanism (2 messages)
- Posted by: Carson Lam
- Posted on: February 20 2001 22:13 EST
Threaded Messages (2)
- J2EE data caching mechanism by Pranab Ghosh on February 21 2001 19:06 EST
- J2EE data caching mechanism by sahil gupta on February 22 2001 10:29 EST
-
J2EE data caching mechanism[ Go to top ]
- Posted by: Pranab Ghosh
- Posted on: February 21 2001 19:06 EST
- in response to Carson Lam
You can use read only entity bean with a long time out period for caching purpose. The data will be refreshed
only at the end of the time out period.
As far as I know, there is no way to notify Weblogic or other app servers that cache is dirty and should be refreshed when data is modified by some other external process.
We have a similar issue with the nightly batch update of our database. We are planning to simply shutdown and restart Weblogic.
Pranab Ghosh
Independent Consultant -
J2EE data caching mechanism[ Go to top ]
- Posted by: sahil gupta
- Posted on: February 22 2001 10:29 EST
- in response to Pranab Ghosh
Hi there Guys,
First of all i am happy to inform u that there is a soln to the aforementioned problem and that is what pranab explained that u can increase the timeout of the entity bean. Carson be informed that the entity bean concept is nothing but a data caching mechanism. So if at all we could have this data cached for a long period then our problem is solved. So what u can do is increase the timeout and set the isModified method so as to avoid Dirty reads and update the database only when data changes. Also u can control the calls to the ejbLoad and the ejbStore using db-is-shared and isModified respectively.
HTH
sahil gupta