# XmlContainer.close

`

###

    import com.sleepycat.dbxml.*;

    public void close(int flags)
        throws XmlException;

# Description

The XmlContainer.close method closes the specified container.

The XmlContainer must be in the open state for the call to succeed. The container is only open after a successful call to the XmlContainer.open method. Note that it is allowable to re-open a container after it has been closed.

Db.DB_NOSYNC
  Do not flush cached information to disk. The Db.DB_NOSYNC flag is a dangerous option. It should be set only if the application is doing logging (with transactions) so that the database is recoverable after a system or application crash, or if the database is always generated from scratch after any system or application crash.

  It is important to understand that flushing cached information to disk only minimizes the window of opportunity for corrupted data. Although unlikely, it is possible for database corruption to happen if a system or application crash occurs while writing data to the database. To ensure that database corruption never occurs, applications must either: use transactions and logging with automatic recovery; use logging and application-specific recovery; or edit a copy of the database, and once all applications using the database have successfully called UNREF==xm_close, atomically replace the original database with the updated copy.

When multiple threads are using the XmlContainer concurrently, only a single thread may call the XmlContainer.close method.

# Class

XmlContainer, XmlDocument, XmlQueryContext

# See Also

XmlContainer.close, XmlContainer.declareIndex, XmlContainer.deleteDocument, XmlContainer.getDocument, XmlContainer.getName, XmlContainer.open, XmlContainer.putDocument and XmlContainer.queryWithXPath.

XmlDocument.getAttributeValue, XmlDocument.getContent, XmlDocument.getID, XmlDocument.getName, XmlDocument.getType, XmlDocument.setContent, XmlDocument.setName, and XmlDocument.setType.

`

Copyright Sleepycat Software