@Override public void inTxn(SSConnection conn, WorkerGroup wg) throws PEException { final SchemaContext sc = SchemaContext.createContext(conn); sc.forceMutableSource(); List<PEContainerTenant> loaded = Functional.apply( tenants, new UnaryFunction<PEContainerTenant, SchemaCacheKey<PEContainerTenant>>() { @Override public PEContainerTenant evaluate(SchemaCacheKey<PEContainerTenant> object) { return sc.getSource().find(sc, object); } }); sc.beginSaveContext(); try { List<CatalogEntity> out = Functional.apply( loaded, new UnaryFunction<CatalogEntity, PEContainerTenant>() { @Override public CatalogEntity evaluate(PEContainerTenant object) { return object.getPersistent(sc); } }); deleted = out; } finally { sc.endSaveContext(); } }
@Override public void executeNested( ExecutionState estate, WorkerGroup wg, DBResultConsumer resultConsumer) throws Throwable { SSConnection conn = estate.getConnection(); SchemaContext cntxt = conn.getSchemaContext(); cntxt.beginSaveContext(); PersistentGroup pg = null; try { pg = onGroup.persistTree(cntxt); } finally { cntxt.endSaveContext(); } QueryStepRebalance rangeRebalance = new QueryStepRebalance(pg, rangeInfo, ignoreFKS); rangeRebalance.executeSelf(estate, wg, DBEmptyTextResultConsumer.INSTANCE); }