public void dropCursor(DustProcCursor cursor) { if (null != cursor) { cursors.Remove(cursor); } }
public DustProcCursor optSetCursor(DustDataEntity ei, DustDataEntity eKey) { DustProcCursor cursor = DustProcCursor.optSet(ei, eKey); if (null != cursor) { cursors.Insert(0, cursor); } return(cursor); }
public bool visitRef(DustDataEntity ei, DustDataEntity eKey, object readerParent, bool close) { bool first = true; DustProcCursor cursor = session.optSetCursor(ei, eKey); if (null != cursor) { Exception procEx = null; try { foreach (DustDataReference ddr in cursor) { callbackTray.entity = ei; callbackTray.value = ddr.eTarget; callbackTray.key = eKey; if (null != dvp) { if (first) { first = false; } else { sendVisitEvent(VisitEvent.refSep); } } if (null != dvp) { object mapId = (DustValType.LinkDefMap == ddr.eLinkDef.optValType) ? ddr.getId() : null; if (null != mapId) { callbackTray.key = mapId; callbackTray.readerParent = readerParent; callbackTray.entity = ddr.eTarget; if (!sendVisitEvent(VisitEvent.keyStartOpt)) { callbackTray.entity = ei; continue; } } callbackTray.entity = ddr.eTarget; visitEntity(readerParent); if (null != mapId) { callbackTray.key = mapId; callbackTray.readerParent = readerParent; callbackTray.entity = ddr.eTarget; sendVisitEvent(VisitEvent.keyEnd); } callbackTray.key = eKey; callbackTray.entity = ddr.eTarget; callbackTray.readerParent = readerParent; sendVisitEvent(VisitEvent.keyEnd); } } if (!first && close) { sendVisitEvent(VisitEvent.visitEnd); } } catch (Exception ex) { callbackTray.readerObject = procEx = ex; sendVisitEvent((ex is DustException) ? VisitEvent.visitAborted : VisitEvent.visitInternalError); } finally { session.cursors.Remove(cursor); } if (null != procEx) { throw procEx; } } return(!first); }