DbEnv::repmgr_site_by_eid()

#include <db_cxx.h>

int 
DbEnv::repmgr_site_by_eid(int eid, DB_SITE **sitep 

The DbEnv::repmgr_site_by_eid() method returns a DbSite handle based on the site's Environment ID value. You use the DbSite handle to configure and manage replication sites.

This method allocates memory for the handle, returning a pointer to the structure in the memory to which sitep refers. To release the allocated memory and discard the handle, call the DbSite::close() method.

The DbEnv::repmgr_site_by_eid() method may be called at any time after environment open time.

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

Parameters

eid

The Environment ID of the site for which you want to create the DbSite handle. You can obtain a site's EID by using the DbSite::get_eid() method.

sitep

References memory into which a pointer to the allocated handle is copied.

Errors

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

If this method is called from a Base API application, or if an invalid flag value or parameter was specified.

Class

DbEnv

See Also

Replication and Related Methods