private Object getUnderTransaction(Object key, long waitForResponse, Transaction txn) throws Exception { try { // bring from remote space SpaceMapEntry template = MapEntryFactory.create(key); _memoryManager.monitorMemoryUsage(true); SpaceMapEntry entry = (SpaceMapEntry) _spaceProxy.readIfExists(template, txn, waitForResponse, ReadModifiers.MATCH_BY_ID); if (entry == null) // can't find in remote space throw new CacheTimeoutException(key); return prepareValue(key, entry); } finally // evicts key from cache to avoid consistency problems { evict(key); } }
return null; throw new CacheTimeoutException(key);
return null; throw new CacheTimeoutException(key);
throw new CacheTimeoutException(key); } catch (Exception e) { throw new SpaceCacheException("Failed to put value in space cache", e);
throw new CacheTimeoutException(key); } catch (Exception e) { throw new SpaceCacheException("Failed to put value in space cache", e);