XmlManager::openContainer
|
 |
#include <DbXml.hpp>
XmlContainer XmlManager::openContainer(const std::string &name)
XmlContainer XmlManager::openContainer(
XmlTransaction &txn, const std::string &name)
XmlContainer XmlManager::openContainer(
const std::string &name, u_int32_t flags)
XmlContainer XmlManager::openContainer(
XmlTransaction &txn, const std::string &name, u_int32_t flags)
Description: XmlManager::openContainer
Opens a container, returning a handle to an XmlContainer object.
Unless DB_CREATE is specified, the container must already exist at the
time that this method is called or an exception is thrown.
Use XmlManager::createContainer, or provide DB_CREATE to the
flags parameter on this method, to create and open a new container.
Containers always remain open until the last handle referencing the
container is destroyed.
Description: XmlManager::openContainer(XmlTransaction &txn, const std::string &name)
Opens the identified container.
Unless DB_CREATE was previously specified on a call to
XmlManager::setDefaultContainerFlags,
the container must have previously been created or an exception is thrown.
Parameters
- txn
- The XmlTransaction object to use for this container open.
- name
- The container's name. The container is created relative to the
underlying environment's home directory (see XmlManager for more
information) unless an absolute path is used for the name; in that case
the container is created in the location identified by the path.
The name provided here must be unique for the environment or an
exception is thrown.
Errors
The XmlManager::openContainer method
may fail and throw
XmlException,
encapsulating one of the following non-zero errors:
- CONTAINER_NOT_FOUND
- Error: Db::open: File exists
Description: XmlManager::createContainer(XmlTransaction &txn, const
std::string &name, u_int32_t flags)
Opens a container. Unless DB_CREATE is specified, the container must
have previously been created or an exception is thrown.
Parameters
- txn
- The XmlTransaction object to use for this container open.
- name
- The container's name. The container is created relative to the
underlying environment's home directory (see XmlManager for more
information) unless an absolute path is used for the name; in that case
the container is created in the location identified by the path.
The name provided here must be unique for the environment or an
exception is thrown.
- flags
- The flags to use for this container open.
The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one
or more of the following values:
- DB_CREATE
- If the container does not currently exist, create it.
- 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_EXCL
- Return an error if the container already exists. The DB_EXCL
flag is only meaningful when specified with the DB_CREATE
flag.
- DB_NOMMAP
- Do not map this container into process memory (see the
DbEnv::set_mp_mmapsize method for further information).
- DB_RDONLY
- Open the container for reading only. Any attempt to modify items in the
container will fail, regardless of the actual permissions of any
underlying files.
- DB_THREAD
- Cause the container handle to be free-threaded;
that is, concurrently usable by multiple
threads in the address space.
- DB_XA_CREATE
- Instead of creating a standalone database, create a database intended
to be accessed via applications running under an X/Open conformant
Transaction Manager. The database will be opened in the environment
specified by the OPENINFO parameter of the GROUPS section of the
ubbconfig file. See the XA
Introduction section in the Berkeley DB Reference Guide for more information.
- DBXML_CHKSUM
- Do checksum verification of pages read into the cache from the
backing filestore. Berkeley DB XML uses the SHA1 Secure Hash Algorithm
if encryption is configured and a general hash algorithm if it is not.
- DBXML_ENCRYPT
- Encrypt the database using the cryptographic password specified to
DbEnv::set_encrypt.
- DBXML_INDEX_NODES
- Relevant for node storage containers only. Causes the indexer to create index
targets that reference nodes rather than documents. This allows
XmlContainer::lookupIndex to return individual nodes rather than whole
documents.
- DBXML_TRANSACTIONAL
- Cause the container to support transactions. If this flag is set, and
XmlTransaction object may be used with any method that supports
transactional protection. Also, if this flag is
used, and if an XmlTransaction object is not provided to a method that modifies
an XmlContainer or XmlDocument object, then auto commit is
automatically used for the operation.
- DBXML_ALLOW_VALIDATION
- When loading documents into the container, validate the XML if
it refers to a DTD or XML Schema.
Errors
The XmlManager::openContainer method
may fail and throw
XmlException,
encapsulating one of the following non-zero errors:
- CONTAINER_CONTAINER_NOT_FOUND
- Error: Db::open: File exists
- INVALID_VALUE
- Invalid flags to method XmlManager::openContainer
Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.