The Db.delete method removes key/data pairs from the database. The key/data pair associated with the specified key is discarded from the database. In the presence of duplicate key values, all records associated with the designated key will be discarded.
When called on a database that has been made into a secondary index using the Db.associate method, the Db.delete method deletes the key/data pair from the primary database and all secondary indices.
|key ||The key Dbt operated on. |
|flags ||must be set to 0 or the following value:
|txnid ||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.txnBegin; otherwise, null. |
|DbException ||The Db.delete method may fail and throw DbException, encapsulating one of the following non-zero errors: An attempt was made to modify a read-only database. |
|DbDeadlockException ||If a transactional database environment operation was selected to resolve a deadlock, the Db.delete method will fail and throw a DbDeadlockException exception. |
|DbLockNotGrantedException ||If a Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable to grant a lock in the allowed time, the Db.delete method will fail and throw a DbLockNotGrantedException exception. |
|IllegalArgumentException ||The Db.delete method will fail and throw a IllegalArgumentException exception if an invalid flag value or parameter was specified. |
Unless otherwise specified, the Db.delete method throws an exception that encapsulates a non-zero error value on failure.
Definition at line 3431 of file Db.java.
return db_javaJNI.Db_del(swigCPtr, DbTxn.getCPtr(txnid), key, flags);