@Override public boolean hasFacet(Ice.Identity ident, String facet) { checkIdentity(ident); if (facet == null) { facet = ""; } _deactivateController.lock(); try { ObjectStore store = findStore(facet, false); if (store == null) { return false; } TransactionI tx = beforeQuery(); if (tx == null) { EvictorElement element = (EvictorElement) store.cache().getIfPinned(ident); if (element != null) { return true; } return store.dbHasObject(ident, null); } else { return store.dbHasObject(ident, tx); } } finally { _deactivateController.unlock(); } }
@Override protected boolean hasAnotherFacet(Ice.Identity ident, String facet) { _deactivateController.lock(); try { java.util.Map<String, ObjectStore> storeMapCopy; synchronized (this) { storeMapCopy = new java.util.HashMap<String, ObjectStore>(_storeMap); } TransactionI tx = beforeQuery(); for (java.util.Map.Entry<String, ObjectStore> entry : storeMapCopy.entrySet()) { // // Do not check this facet again // if (!facet.equals(entry.getKey())) { ObjectStore store = entry.getValue(); if (tx == null && store.cache().getIfPinned(ident) != null) { return true; } if (store.dbHasObject(ident, tx)) { return true; } } } return false; } finally { _deactivateController.unlock(); } }