Interface RequestResult

  • All Superinterfaces:
    AutoCloseable, Iterable<Adaptation>

    public interface RequestResult
    extends Iterable<Adaptation>, AutoCloseable
    Represents the result of a Request.

    Traversing and closing the result

    A RequestResult instance must always be closed after its use.

    Here is a code sample benefiting from the automatic closing provided by AutoCloseable and its associated try-with-resources notation:

     
     try (RequestResult result = ...)
     {
            for (Adaptation record : result)
            {
                    ...
            }
     }
     
     

    Note that a RequestResult can be traversed only once, either by iterator (like the above example) or by nextAdaptation(). Trying to create multiple iterators will result in an exception. Similarly, trying to call nextAdaptation() after an iterator has been created (or vice-versa) will also result in an exception.

    Concurrency

    A RequestResult instance is not thread-safe and it must be used only by the thread that created it.

    If the table is concurrently updated, the rules specified by Query snapshot isolation apply.

    See Also:
    Request, QueryResult, Query snapshot isolation