MarkLogic XCC/.Net Library |

# ResultSequence Interface

A sequence of ResultItem values as returned from a query or module execution. A ResultSequence instance is stateful, it holds an internal positional index (cursor) which is updated on successive accesses. It is therefore not recommended that ResultSequence objects be accessed concurrently by multiple threads.

ResultSequence instances can operate in two modes: cached and non-cached. If a ResultSequence is cached (default) then all XdmItems have been read and buffered. If non-cached, then items may only be accessed sequentially and some values may only be fetched once if accessed as a Stream.

Cached ResultSequences need not be closed. Upon return, they no longer tie up any connection resources. However, closing a cached ResultSequence will invalidate it and prevent further access to its contents.

Streaming (non-cached) ResultSequences should always be promptly closed. They hold a server connection until closed. If not closed, connections may be tied up indefinitely. Additionally, you should always consume the ResultSequence in a timely manner, because the server may close the connection if the (server-side configurable) request tiemout expires before the data is read out.

In general, it is preferable to use cached ResultSequences (this is the default) unless you have reason to believe the amount of data returned may be too large to be fully buffered in memory.

For a list of all members of this type, see ResultSequence Members.

[Visual Basic]
Public Interface ResultSequence
Implements XdmSequence, XdmValue
[C#]
public interface ResultSequence : XdmSequence, XdmValue

#### Requirements

Namespace: Marklogic.Xcc

Assembly: MarklogicXcc (in MarklogicXcc.dll)

#### See Also

ResultSequence Members | Marklogic.Xcc Namespace