public Object getVersion(Transaction tx) { if (tx == null) return currentObject; return txLocal.get(tx); }
/** * Returns the value of this TransactionLocal variable associated with the * thread context transaction. Creates and initializes the copy if this is * the first time the method is called in a transaction. * * @return the value of this TransactionLocal */ public Object get() { return get(getTransaction()); }
private LinkedList getCache() { return (LinkedList) cacheTxLocal.get(); } }
/** * Returns the value of this TransactionLocal variable associated with the * thread context transaction. Creates and initializes the copy if this is * the first time the method is called in a transaction. * * @return the value of this TransactionLocal */ public Object get() { return get(getTransaction()); }
/** * @return Map of lists of waiting related PK values keyed by not yet created this side's PK value. */ private Map getRelatedPKsWaitingForMyPK() { return (Map) relatedPKValuesWaitingForMyPK.get(); }
public RelationData getRelationData() { final RelationData local = (RelationData) relationData.get(); return local; } }
private Map getLocalCache() { return (Map) txLocalCache.get(); } }
public boolean isCascadeDeleted(Object key) { Map map = (Map)cascadeDeleteRegistry.get(); return map.containsKey(key); }
public EntityEnterpriseContext getCtx(Transaction tx, Object key) { HashMap entityMap = (HashMap) m_map.get(tx); if(entityMap == null) return null; return (EntityEnterpriseContext) entityMap.get(key); }
public boolean registerCascadeDelete(Object key, Object value) { Map map = (Map)cascadeDeleteRegistry.get(); return map.put(key, value) == null; }
public EntityEnterpriseContext getCtx(Object key) { HashMap entityMap = (HashMap) m_map.get(); if(entityMap == null) return null; return (EntityEnterpriseContext) entityMap.get(key); } }
public void unregisterCascadeDelete(Object key) { Map map = (Map)cascadeDeleteRegistry.get(); map.remove(key); }
public void checkOptimisticLock(Transaction tx) { // NOTE THIS CODE ASSUMES THAT A WRITELOCK HAS BEEN ACQUIRED!!!! Long version = (Long)txVersion.get(tx); if (version.longValue() <= versionId) throw new OptimisticLockFailure("optimistic lock failure for list"); }
/** * Schedules instances for cascade-delete */ public void scheduleCascadeDelete(List pks) { CascadeDeleteRegistry registry = (CascadeDeleteRegistry)cascadeDeleteSet.get(); registry.scheduleAll(pks); }
public void checkOptimisticLock(Transaction tx) { // NOTE THIS CODE ASSUMES THAT A WRITELOCK HAS BEEN ACQUIRED!!!! Long version = (Long)txVersion.get(tx); if (version.longValue() <= versionId) throw new OptimisticLockFailure("optimistic lock failure for set"); }
/** * sync all EntityEnterpriseContext that are involved (and changed) * within a transaction. */ public void synchronizeEntities(Transaction tx) { GlobalTxSynchronization globalSync = (GlobalTxSynchronization) txSynch.get(tx); if(globalSync != null) { globalSync.synchronize(); } }
public GlobalTxSynchronization getGlobalSynchronization(Transaction tx) throws RollbackException, SystemException { GlobalTxSynchronization globalSync = (GlobalTxSynchronization) txSynch.get(tx); if(globalSync == null) { globalSync = new GlobalTxSynchronization(tx); txSynch.set(tx, globalSync); tx.registerSynchronization(globalSync); } return globalSync; }