XmlQueryContext.setEvaluationType

APIRef

import com.sleepycat.dbxml.*;

public void setEvaluationType(EvaluationType type) throws XmlException;

Description

The XmlQueryContext.setEvaluationType method sets the query evaluation type. This option is provided as large result sets could consume large amounts of memory. By electing lazy evaluation the caller can read documents into memory as needed. The type must be set to one of the following values:

Db.XmlQueryContext::Eager
The whole query is executed and its restultant values derived and stored in-memory before the call to XmlContainer.queryWithXPath returns.

Db.XmlQueryContext::Lazy
Perform as little up-front processing as possible, deferring all processing to results iteration. This means that as each call to XmlResults.next is called the next resultant value is determined.

The XmlQueryContext.setEvaluationType method throws an exception that encapsulates a non-zero error value on failure.

Errors

The XmlQueryContext.setEvaluationType method may fail and throw an exception encapsulating a non-zero error for the following conditions:

EINVAL
An invalid flag value or parameter was specified.

The XmlQueryContext.setEvaluationType method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the XmlQueryContext.setEvaluationType method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.

Class

XmlContainer, XmlDocument, XmlQueryContext

See Also

XmlContainer.close, XmlContainer.declareIndex, XmlContainer.deleteDocument, XmlContainer.getDocument, XmlContainer.getName, XmlContainer.open, XmlContainer.putDocument and XmlContainer.queryWithXPath.

XmlDocument.getAttributeValue, XmlDocument.getContent, XmlDocument.getID, XmlDocument.getName, XmlDocument.getType, XmlDocument.setContent, XmlDocument.setName, and XmlDocument.setType.

APIRef

Copyright Sleepycat Software