/** * Close. */ void close() { doFlush(); // Close all clients created in this session if (!clientMap.isEmpty()) { for (Client client : clientMap.values()) { client.close(); } clientMap.clear(); } onClearProxy(); // TODO: Move all nodes tied to this EM into detached state, need to // discuss with Amresh. closed = true; }
@Override public final void flush() { checkClosed(); getPersistenceDelegator().doFlush(); }
private void applyOperations(PersistenceDelegator pd, OToOOwnerEntity found, AssociationEntity association, boolean remove) { found.setAssociation(association); pd.merge(found); pd.doFlush(); pd.detach(association); pd.merge(found); // detach over association entity should work. if (remove) pd.remove(found); // since we have called merge, so association // entity should be in MANAGED_STATE and cascade // should work. } }
private void persist(PersistenceDelegator pd) { OToOOwnerEntity owner; owner = new OToOOwnerEntity(); owner.setAmount(10); owner.setName("owner1"); owner.setRowKey((byte) 1); // pd = ((EntityManagerImpl) em1).getPersistenceDelegator(); pd.persist(owner); pd.doFlush(); pd.clear(); }