Berkeley DB: DbSequence::open
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++

### DbSequence::open |

`

###

    #include <db_cxx.h>

    int
    int
    DbSequence::open(DbTxn *txnid, Dbt *key, u_int32_t flags);

    int
    DbSequence::get_dbp(Db **dbp);

    int
    DbSequence::get_key(Dbt *key);

### Description: DbSequence::open

The DbSequence::open method opens the sequence represented by the key. The key must be compatible with the underlying database specified in the corresponding call to db_sequence_create.

### Parameters

key
  The key specifies which record in the database stores the persistent sequence data.
flags
  The flags parameter must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
  DB_AUTO_COMMIT
    Enclose the DbSequence::open call within a transaction. If the call succeeds, the open operation will be recoverable. If the DB_CREATE flag is specified and the call fails, no sequence will have been created.
  DB_CREATE
    Create the sequence. If the sequence does not already exist and the DB_CREATE flag is not specified, the DbSequence::open will fail.
  DB_EXCL
    Return an error if the sequence already exists. The DB_EXCL flag is only meaningful when specified with the DB_CREATE flag.
  DB_THREAD
    Cause the DbSequence handle returned by DbSequence::open to be free-threaded; that is, usable by multiple threads within a single address space.
txnid
  If the operation is to be transaction-protected, (other than by specifying the DB_AUTO_COMMIT flag), the txnid parameter is a transaction handle returned from DbEnv::txn_begin; otherwise, NULL. Note that transactionally protected operations on a DbSequence handle require the DbSequence handle itself be transactionally protected during its open if the open creates the sequence.

### Description: DbSequence::get_dbp

The DbSequence::get_dbp method returns the database handle.

### Parameters

dbp
  The dbp parameter references memory into which a pointer to the database handle is copied.

The DbSequence::get_dbp method may be called at any time during the life of the application.

The DbSequence::get_dbp 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.

### Description: DbSequence::get_key

The DbSequence::get_key method returns the key for the sequence.

### Parameters

key
  The key parameter references memory into which a pointer to the key data is copied.

The DbSequence::get_key method may be called at any time during the life of the application.

The DbSequence::get_key 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.

### Class

DbSequence

### See Also

Sequences and Related Methods`

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