DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

DB_ENV->rep_start

API Ref

#include <db.h>

int DB_ENV->rep_start(DB_ENV *env, DBT *cdata, u_int32_t flags);


Description: DB_ENV->rep_start

The DB_ENV->rep_start method configures the database environment as a client or master in a group of replicated database environments. Replication master environments are the only database environments where replicated databases may be modified. Replication client environments are read-only as long as they are clients. Replication client environments may be upgraded to be replication master environments in the case that the current master fails or there is no master present.

The enclosing database environment must already have been opened by calling the DB_ENV->open method and must already have been configured to send replication messages by calling the DB_ENV->set_rep_transport method.

The DB_ENV->rep_start method returns a non-zero error value on failure and 0 on success.

Parameters

cdata
The cdata parameter is an opaque data item that is sent over the communication infrastructure when the client or master comes online (see Connecting to a new site for more information). If no such information is useful, cdata should be NULL.
flags
The flags parameter must be set to one of the following values:
DB_REP_CLIENT
Configure the environment as a replication client.
DB_REP_MASTER
Configure the environment as a replication master.

Errors

The DB_ENV->rep_start method may fail and return one of the following non-zero errors:

EINVAL
If the database environment was not already configured to communicate with a replication group by a call to DB_ENV->set_rep_transport; the database environment was not already opened; or if an invalid flag value or parameter was specified.

Class

DB_ENV

See Also

Replication and Related Methods

APIRef

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