RE: [Opensymphony-oscache] Thread Issue

Radhakrishnan J <[email protected]> Thu, 18 Aug 2005 11:48:56 +0530
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <38FB0F3A5CCB9545ABF325368DEBFCFE0630C7@indiamail4.india.tavant.com>
Ideally, it'd be better to have a try{} finally{} in the
catch(NeedsRefreshException nre} {...} block. Its possible that
putInCache(..) throws a 'java.lang.Error' and this could cause indefinite
blockage. Which leads to the next question, do you see any stack traces that
indicate this possibility ? If not, I can't explain this.

Thanks,
Radhakrishnan

-----Original Message-----
From: rufus [mailto:[email protected]]
Sent: Thursday, August 18, 2005 11:28 AM
To: [email protected]
Subject: [Opensymphony-oscache] Thread Issue


1. We have a following method in our application. It is using either
putInCache() or cancelUpdate() after the call to
getFromCache(). But still on heavy load all the thread are blocked by this
method. Can anybody tell us whats wrong here?

public String getConfiguration(String name) throws ConfigurationException{
	String configValue = null;
	try{
	    int interval=3600;
	    configValue = (String) cacheAdmin.getFromCache(name,interval);
	}catch (NeedsRefreshException nre) {
	    try{
		configValue =
myConfigDatabaseControl.getConfiguration(name);
		cacheAdmin.putInCache(name, configValue);
	    }catch (Exception ex) {
		configValue = (String) nre.getCacheContent();
		cacheAdmin.cancelUpdate(name);
	    }
	}
	return configValue;
}

2. Will synchronization of this method solve the problem?

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1612&messageID=13151#131
51


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]