XmlManager::upgradeContainer

#include <DbXml.hpp>

void XmlManager::upgradeContainer(const std::string &name,
    XmlUpdateContext &context);

Upgrades the container from a previous version of Berkeley DB XML, or Berkeley DB, to the current version. A Berkeley DB upgrade is first performed using the Db::upgrade method, and then the Berkeley DB XML container is upgraded. If no upgrade is needed, then no changes are made.

Note

Container upgrades are done in place and are destructive. For example, if pages need to be allocated and no disk space is available, the container may be left corrupted. Backups should be made before containers are upgraded. See Upgrading databases for more information.

The container must be closed; the system throws an exception if the container is open.

Parameters

name

The name of the container to be upgraded.

context

The XmlUpdateContext object to be used for this operation.

Errors

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

CONTAINER_OPEN

The container is open.

DATABASE_ERROR

An error occurred in an underlying Berkeley DB database. The XmlException::getDbErrno method will return the error code for the error.

Class

XmlManager

See Also

XmlManager Methods