method insertDataintoCache modified adding the check on the presence of the key (associated to a data) in a cache.
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/databases-manager-portlet@101677 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0f467e02b7
commit
359e7a83c6
|
@ -2135,11 +2135,13 @@ public class GWTdbManagerServiceImpl extends RemoteServiceServlet implements
|
|||
private synchronized void insertDataIntoCache(net.sf.ehcache.Element data) throws Exception{
|
||||
|
||||
if(cacheManager.cacheExists("DBCache")){
|
||||
logger.info("dbmanager-> disk store path for cache: " + cacheManager.getDiskStorePath() +"Cache Status: "+DBCache.getStatus().toString());
|
||||
logger.info("dbmanager-> disk store path for cache: " + cacheManager.getDiskStorePath() +" Cache Status: "+DBCache.getStatus().toString());
|
||||
if (DBCache.getStatus().toString().equals(Status.STATUS_ALIVE.toString())){
|
||||
DBCache.put(data);
|
||||
logger.trace("dbmanager-> element with key: " + data.getKey().toString()+" added in cache");
|
||||
|
||||
if(DBCache.isKeyInCache(data.getKey().toString())){
|
||||
logger.trace("dbmanager-> element with key: " + data.getKey().toString()+" added in cache");
|
||||
}
|
||||
|
||||
logger.info("dbmanager-> ** SIZE OF THE MEMORY STORE: "+ DBCache.calculateInMemorySize());
|
||||
// logger.trace("dbmanager-> ** SIZE OF THE OFF HEAP"+ DBCache.calculateOffHeapSize());
|
||||
logger.info("dbmanager-> ** SIZE OF THE DISK STORE SIZE: "+ DBCache.calculateOnDiskSize());
|
||||
|
|
Loading…
Reference in New Issue