URGENT! reg. Caching of data...... 2004-08-11 - By Partha Ranjan Das
Back Hi,
There is some pattern called 'Context Object' which can come to your help. I assume that you will be using an object in application context in the web container. For your updates into this object from JMS, you will possibly implement MessageListener, MessageConsumer in a class which can call a servlet (servlet1) method which has access to the ServletContext where the context object is stored. Using a timer/timer task started up from a start-up servlet (servlet2), you can call the same method in the servlet1 to do the update into the context object. If you are using a class with static fields for this cache, do not do that.
By the way, if you are going for auto-refresh, why do you need to use a MOM solution whose response may be delayed due to underlying MOM architecture.
Regards, Partha
-- ---- -- From: Manish Malhotra [SMTP:manish.mmalhotra@(protected)] Sent: Tuesday, August 10, 2004 3:54 PM To: J2EE-INTEREST@(protected) Subject: URGENT! reg. Caching of data......
Hi All,
I need to cache the data at the time of start up of the applciation from the DB to reduce the DB hit. So, I designed one caching class which is doing this. But this statis cache means it never updates automatically. But it updated through the JMS a asynchrounous process when we change the data in the DB using our web module. I need to make it also auto refreshed. So, I plan to use Timer / Timertask classes of JDK1.4. I want to know is this the right approach?
Please let me know as soon as possible.
Many Thanks.
Manish Malhotra
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. *********************************************************************
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|