### XmlContainer::rename |

`

###

    #include <DbXml.hpp>

    void XmlContainer::rename(DbTxn *txn, const std::string &newName, u_int32_t flags=0);

### Description: XmlContainer::rename

The XmlContainer::rename method renames the container's underlying file. Note that the name of the container object in memory is not changed - for that, use XmlContainer::setName.

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

The container must have been opened at least once; the system throws an exception if the underlying file has not yet been created.

### Parameters

txn
  If the operation is to be transaction-protected, the txn parameter is a transaction handle returned from DbEnv::txn_begin, otherwise, NULL.

newName
  The new container name.

flags
  must be set to zero, or a value created by bitwise inclusively OR'ing one or more of the following values:

  DB_AUTO_COMMIT
    Automatically wrap the operation in a transaction.

### Errors

The XmlContainer::rename 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::getDbError method will return the error code for the error.

### Class

XmlContainer, XmlDocument, XmlException, XmlIndexSpecification, XmlQueryContext, XmlQueryExpression, XmlResults, XmlUpdateContext, XmlValue`

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.