#include <db_cxx.h>
DbEnv::rep_sync(u_int32_t flags);

The DbEnv::rep_sync() method forces master synchronization to begin for this client. This method is the other half of setting the DB_REP_CONF_DELAYCLIENT flag via the DbEnv::rep_set_config() method.

If an application has configured delayed master synchronization, the application must synchronize explicitly (otherwise the client will remain out-of-date and will ignore all database changes forwarded from the replication group master). The DbEnv::rep_sync() method may be called any time after the client application learns that the new master has been established (by receiving a DB_EVENT_REP_NEWMASTER event notification).

Before calling this method, the enclosing database environment must already have been opened by calling the DbEnv::open() method and must already have been configured to send replication messages by calling the DbEnv::rep_set_transport() method.

The DbEnv::rep_sync() 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.



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


The DbEnv::rep_sync() 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:


If the database environment was not already configured to communicate with a replication group by a call to DbEnv::rep_set_transport(); the database environment was not already opened; or if an invalid flag value or parameter was specified.



See Also

Replication and Related Methods