### XmlContainer.getDocument |

`

###

    import com.sleepycat.dbxml.*;

    public XmlDocument getDocument(DbTxn txn, int id, int flags)
        throws XmlException;

### Description: XmlContainer.getDocument

The XmlContainer.getDocument method returns the XmlDocument corresponding to the specified document ID.

### Parameters

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

id
  The ID of the XmlDocument to be retrieved from the container.

flags
  The flags parameter must be set to zero or one of the following values:

  Db.DB_DIRTY_READ
    Read modified but not yet committed data. Silently ignored if the Db.DB_DIRTY_READ flag was not specified when the underlying XmlContainer was opened.

  Db.DB_RMW
    Acquire write locks instead of read locks when doing the retrieval. Setting this flag can eliminate deadlock during a read-modify-write cycle by acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock.

    Because the XmlContainer.getDocument method will not hold locks across Berkeley DB interface calls in non-transactional environments, the Db.DB_RMW flag to the XmlContainer.getDocument call is meaningful only in the presence of transactions.

Returns the XmlDocument corresponding to the specified document ID.

### Throws

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

CONTAINER_CLOSED
  The container is closed.

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

DOCUMENT_NOT_FOUND
  The specified document is not in the XmlContainer.

### Class

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

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