DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

Dbc::close

API Ref

#include <db_cxx.h>

int Dbc::close(void);


Description: Dbc::close

The Dbc::close method discards the cursor.

It is possible for the Dbc::close method to return DB_LOCK_DEADLOCK, signaling that any enclosing transaction should be aborted. If the application is already intending to abort the transaction, this error should be ignored, and the application should proceed.

After Dbc::close has been called, regardless of its return, the cursor handle may not be used again.

The Dbc::close method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Errors

The Dbc::close method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

EINVAL
If the cursor is already closed; or if an invalid flag value or parameter was specified.

If a transactional database environment operation was selected to resolve a deadlock, the Dbc::close method will fail and either return DB_LOCK_DEADLOCK or throw a DbDeadlockException exception.

If a Berkeley DB Concurrent Data Store database environment configured for lock timeouts was unable to grant a lock in the allowed time, the Dbc::close method will fail and either return DB_LOCK_NOTGRANTED or throw a DbLockNotGrantedException exception.


Class

Dbc

See Also

Database Cursors and Related Methods

APIRef

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