XmlContainer.deleteDocument

APIRef

import com.sleepycat.dbxml.*;

public void deleteDocument(DbTxn txnid, int id, int flags) throws DbException;

Description

The XmlContainer.deleteDocument method removes the document identified by the id parameter from the container.

If the operation is to be transaction-protected (other than by specifying the Db.DB_AUTO_COMMIT flag), the txnid parameter is a transaction handle returned from DbEnv.txn_begin; otherwise, null.

The flags value must be set to 0 or the following value:

Db.DB_AUTO_COMMIT
Enclose the XmlContainer.deleteDocument call within a transaction. If the call succeeds, changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.

If the specified document is not in the container, the XmlContainer.deleteDocument method will return Db.DB_NOTFOUND. Otherwise, the XmlContainer.deleteDocument method throws an exception that encapsulates a non-zero error value on failure.

Errors

If the operation was selected to resolve a deadlock, the XmlContainer.deleteDocument method will fail and throw a DbDeadlockException exception.

The XmlContainer.deleteDocument method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the XmlContainer.deleteDocument method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.

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.

APIRef

Copyright Sleepycat Software