DbSequence::get API Ref

#include <db_cxx.h>

int DbSequence::get(DbTxn *txnid, int32_t delta, db_seq_t *retp, u_int32_t flags);


Description: DbSequence::get

The DbSequence::get method returns the next available element in the sequence and changes the sequence value by delta. The value of delta must be greater than zero. If there are enough cached values in the sequence handle then they will be returned. Otherwise the next value will be fetched from the database and incremented (decremented) by enough to cover the delta and the next batch of cached values.

For maximum concurrency a non-zero cache size should be specified prior to opening the sequence handle and DB_TXN_NOSYNC should be specified for each DbSequence::get method call.

By default, sequence ranges do not wrap; to cause the sequence to wrap around the beginning or end of its range, specify the DB_SEQ_WRAP flag to the DbSequence::set_flags method.

The DbSequence::get method will return EINVAL if the record in the database is not a valid sequence record, or the sequence has reached the beginning or end of its range and is not configured to wrap.

Parameters
delta flags retp txnid


Class DbSequence
See Also Sequences and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.