DbSequence
Prev | Chapter 12. The DbSequence Handle | Next

## DbSequence

    #include <db_cxx.h>

    class DbSequence {
    public:
            DbSequence(Db *db, u_int32_t flags);
            ~DbSequence();

            DB_SEQUENCE *DbSequence::get_DB();
            const DB *DbSequence::get_const_DB() const;
            static DbSequence *DbSequence::get_DbSequence(DB *db);
            static const DbSequence
                *DbSequence::get_const_DbSequence(const DB *db);
            ...
    };

The `DbSequence` handle is the handle used to manipulate a sequence object. A sequence object is stored in a record in a database.

`DbSequence` handles are free-threaded if the DB_THREAD flag is specified to the DbSequence::open() method when the sequence is opened. Once the DbSequence::close() or DbSequence::remove() methods are called, the handle can not be accessed again, regardless of the method's return.

Each handle opened on a sequence may maintain a separate cache of values which are returned to the application using the DbSequence::get() method either singly or in groups depending on its delta parameter.

Calling the DbSequence::close() or DbSequence::remove() methods discards this handle.

### Parameters

#### db

The db parameter is an open database handle which holds the persistent data for the sequence. The database may be of any type, but must not have been configured to support duplicate data items.

#### flags

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

### Errors

The `db_sequence_create` method may fail and throw a DbException exception, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DbSequence

### See Also

Sequences and Related Methods

Prev | Up | Next
Chapter 12. The DbSequence Handle | Home | DbSequence::close()