)I"Berkeley DB: Db.del[P

Db.del





import com.sleepycat.db.*;

0public void del(DbTxn txnid, Dbt key, int flags) throws DbException;





Description



;The Db.del method removes key/data pairs from the database.GThe key/data pair associated with the specified key is discardedfrom the database.HIn the presence of duplicate key values, all records associated with the!designated key will be discarded.

;If the file is being accessed under transaction protection,<the txnid parameter is a transaction ID returned fromQDbTxnMgr.begin, otherwise, NULL.

EThe flags parameter is currently unused, and must be set to 0.

The Db.delHmethod throws an exception that encapsulates an errno on failure,Fand DB_NOTFOUND if the specified key did not exist in the file.



Errors

NIf a fatal error occurs in Berkeley DB, the Db.del method may fail and throw a}DbRunRecoveryException, at which point all subsequent database%calls will also fail in the same way.

The Db.del&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions:6Db.cursor,DBcursor->c_close(3),DBcursor->c_del(3),2Dbc.get,__account_page(3),dbenv->db_paniccall(3), fflush(3), fprintf(3),free(3),func(3),hcp->dbc->dbp->h_hash(3),>DbLockTab.get,8DbLock.put,>DbLockTab.vec,6DbLog.put, malloc(3), memcmp(3), memcpy(3), memmove(3),BDbMpoolFile.get,BDbMpoolFile.put,BDbMpoolFile.set, memset(3), realloc(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the Db.del&method may fail and throw an exceptionencapsulating errnofor the following conditions:

D

EACCES
An attempt was made to modify a read-only database.


B

EINVAL
An invalid flag value or parameter was specified.







Class

-Db



See Also

4Db.close,6Db.cursor,Db.del,.Db.fd,0Db.get,HDb.get_byteswapped,:Db.get_type,2Db.join,2Db.open,0Db.put,1Db.statand2Db.sync.
ÿÿ