[Opensymphony-oscache] Thread Issue
rufus <[email protected]> Thu, 18 Aug 2005 00:57:57 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <714335.1124344762301.JavaMail.os-j2ee@opensymphony01.contegix.com> |
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#13151