XmlQueryExpression::execute
|
 |
#include <DbXml.hpp>
XmlResults XmlQueryExpression::execute(
XmlQueryContext &queryContext, u_int32_t flags = 0)
XmlResults XmlQueryExpression::execute(const XmlValue &contextItem,
XmlQueryContext &queryContext, u_int32_t flags = 0)
XmlResults XmlQueryExpression::execute(
XmlTransaction &txn, XmlQueryContext &queryContext, u_int32_t flags = 0)
XmlResults XmlQueryExpression::execute(XmlTransaction &txn,
const XmlValue &contextItem, XmlQueryContext &queryContext, u_int32_t flags = 0)
Description: XmlQueryExpression::execute
Evaluates (runs) an XQuery query that was previously prepared by
XmlManager::prepare and returns an XmlResults set.
There are two basic forms of this method: one that takes an
XmlValue object, and another that does not. For methods that do
not take an XmlValue, the XQuery must restrict the scope of the query
using either the collection() or the doc() XQuery navigation functions,
or an exception is thrown.
For those forms of this method that take an XmlValue, the query
is applied against that object.
Description: XmlQueryExpression.execute(
XmlTransaction &txn, XmlQueryContext &queryContext, u_int32_t flags = 0)
Evaluates the XQuery expression against the containers and documents
identified by the query, from within the scope of the provided
XmlTransaction object..
Parameters
- txn
- If the operation is to be transaction-protected, the txn
parameter is an XmlTransaction handle returned from
XmlManager::createTransaction.
- queryContext
- The XmlQueryContext to use for this evaluation.
- flags
- The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one
or more of the following values:
- DB_DIRTY_READ
- Only meaningful for transactional containers. Causes the container to
Support dirty reads; that is, read operations on the container may
return data that has been modified by other transactions but which has
not yet been committed.
- DB_RMW
- Acquire write locks instead of read locks when doing the retrieval.
Setting this flag can eliminate deadlock during a read-modify-write
cycle by acquiring the write lock during the read part of the cycle so
that another thread of control acquiring a read lock for the same item,
in its own read-modify-write cycle, will not result in deadlock.
- DBXML_LAZY_DOCS
- Retrieve the document lazily. That is, retrieve document content and
document metadata only on an as needed basis when reading the document.
Description: XmlQueryExpression.execute(
XmlTransaction &txn, const XmlValue &contextItem, XmlQueryContext &queryContext, u_int32_t flags = 0)
Evaluates the XQuery expression against the provided context item.
Parameters
- txn
- The XmlTransaction object to use for this evaluation.
- contextItem
- The XmlValue object to perform the query against.
- queryContext
- The XmlQueryContext to use for this evaluation.
- flags
- The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one
or more of the following values:
- DB_DIRTY_READ
- Only meaningful for transactional containers. Causes the container to
Support dirty reads; that is, read operations on the container may
return data that has been modified by other transactions but which has
not yet been committed.
- DB_RMW
- Acquire write locks instead of read locks when doing the retrieval.
Setting this flag can eliminate deadlock during a read-modify-write
cycle by acquiring the write lock during the read part of the cycle so
that another thread of control acquiring a read lock for the same item,
in its own read-modify-write cycle, will not result in deadlock.
- DBXML_LAZY_DOCS
- Retrieve the document lazily. That is, retrieve document content and
document metadata only on an as needed basis when reading the document.
Errors
The XmlQueryExpression::execute method
may fail and throw
XmlException,
encapsulating one of the following non-zero errors:
- INVALID_VALUE
- Invalid flags to method XmlQueryExpression::execute
Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.