[Opensymphony-oscache] Error in mass concurrence!
hgwnet <[email protected]> Fri, 15 Apr 2005 06:35:57 CDT
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <5951536.1113565030630.JavaMail.os-j2ee@opensymphony01.contegix.com> |
Following is my wrapping code:
[code]
// synchronized (this) { //Uncomment this line ,when 1000 threads geting/removing/putting you will by chance see ERROR :java.lang.IllegalStateException: Cannot cancel cache update - current state (-1) is not UPDATE_IN_PROGRESS
try {
obj = cache.getFromCache(k);
if (obj != null) {
found = true;
}
} catch (NeedsRefreshException e) {
cache.cancelUpdate(k);
} catch (Exception e) {
e.printStackTrace();
}
//}[/code]
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1556&messageID=4893#4893