XmlManager

API Ref

#include <DbXml.hpp>

XmlManager::XmlManager(DbEnv *dbenv, u_int32_t flags = 0) XmlManager::XmlManager(u_int32_t flags) XmlManager::XmlManager() XmlManager::XmlManager(const XmlManager &o) XmlManager &operator = (const XmlManager &o) XmlManager::~XmlManager()


Description: XmlManager

Provides a high-level object used to manage various aspects of Berkeley DB XML usage. You use XmlManager to perform activities such as container management (including creation and open), preparing XQuery queries, executing one-off queries, creating transaction objects, creating update and query context objects, and creating input streams.

A copy constructor and assignment operator are provided for this class. The class is implemented using a handle-body idiom. When a handle is copied both handles maintain a reference to the same body.

This object is free threaded, and can be safely shared among threads in an application.

Description: XmlManager(DbEnv *dbenv, u_int32_t flags = 0)

XmlManager constructor that uses the provided DbEnv for the underlying environment. The Berkeley DB subsystems initiated by this environment (for example, transactions, logging, the memory pool), are the subsystems that are available to Berkeley DB XML when operations are performed using this manager object.

Parameters

dbenv
The DbEnv to use for the underlying database environment. The environment provided here must be opened.
flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
DBXML_ALLOW_EXTERNAL_ACCESS
If set, this flag allows XQuery queries to access data sources external to the container, such as files on disk or http URIs. By default, such access is not allowed.
DBXML_ALLOW_AUTO_OPEN
If set, XQuery queries that reference unopened containers will automatically open those containers, and close them when references resulting from the query are released. By default, a query will fail if it refers to containers that are not open.
DBXML_ADOPT_DBENV
If set, the XmlManager object will close and delete the underlying DbEnv object at the end of the XmlManager's life.

Errors

The XmlManager method may fail and throw XmlException, encapsulating one of the following non-zero errors:

INVALID_VALUE
Null DbEnv pointer, or invalid flags passed as parameter to XmlManager.

Description: XmlManager(u_int32_t flags)

XmlManager constructor that uses a private internal database environment. This environment is opened with DB_PRIVATE|DB_CREATE|DB_INIT_MPOOL. These flags allow the underlying environment to be created if it does not already exist. In addition, the memory pool (in-memory cache) is initialized and available. Finally, the environment is private, which means that no external processes can join the environment, but the XmlManager object can be shared between threads within the opening process.

Note that for this form of the constructor, the environment home is located in either the current working directory, or in the directory identified by the DB_HOME environment variable.

Parameters

flags
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
DBXML_ALLOW_EXTERNAL_ACCESS
If set, this flag allows XQuery queries to access data sources external to the container, such as files on disk or http URIs. By default, such access is not allowed.
DBXML_ALLOW_AUTO_OPEN
If set, XQuery queries that reference unopened containers will automatically open those containers, and close them when references resulting from the query are released. By default, a query will fail if it refers to containers that are not open.

Errors

The XmlManager method may fail and throw XmlException, encapsulating one of the following non-zero errors:

INTERNAL_ERROR
Error opening default database environment
INVALID_VALUE
Invalid flags passed as parameter to XmlManager.

Description: XmlManager()

A default XmlManager constructor. This constructor provides the same behavior as passing a flags parameter of 0 to the constructor that takes a single flags parameter. This constructor is provided for convenience.


APIRef

Copyright (c) 1996,2007 Oracle. All rights reserved.