db_sequence_create

API Ref

#include <db.h>

typedef struct __db_sequence DB_SEQUENCE;

int db_sequence_create(DB_SEQUENCE **seq, DB *db, u_int32_t flags);


Description: db_sequence_create

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

DB_SEQUENCE handles are free-threaded if the DB_THREAD flag is specified to the DB_SEQUENCE->open method when the sequence is opened. Once the DB_SEQUENCE->close or DB_SEQUENCE->remove methods are called, the handle may 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 DB_SEQUENCE->get method either singly or in groups depending on its delta parameter.

The DB_SEQUENCE method creates a DB_SEQUENCE object that serves as the handle for a sequence. Calling the DB_SEQUENCE->close or DB_SEQUENCE->remove methods will discard the handle.

The db_sequence_create method returns a non-zero error value on failure and 0 on success.

Parameters

seq
The seq parameter references the memory into which the returned structure pointer is stored.
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 may 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 return one of the following non-zero errors:

EINVAL
An invalid flag value or parameter was specified.

Class

DB_SEQUENCE

See Also

Sequences and Related Methods

APIRef

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