Berkeley DB: Dbc::close
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

# Dbc::close |

`

###

    #include <db_cxx.h>

    int
    Dbc::close(void);

# Description

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.

Once 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 an exception or return a non-zero error for the following conditions:

DB_LOCK_DEADLOCK
  The operation was selected to resolve a deadlock.

EINVAL
  An invalid flag value or parameter was specified.

  The cursor was previously closed.

The Dbc::close method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the Dbc::close method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.

### Class

Dbc

# See Also

Dbc::close, Dbc::count, Dbc::del, Dbc::dup, Dbc::get and Dbc::put.`

Copyright Sleepycat Software