Library Version 18.1.40

DbEnv::repmgr_site_by_eid()
Prev | Chapter 11. Replication Methods | Next

## 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 opening the environment.

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:

#### DB_NOTFOUND

Returned if there is no site corresponding to the supplied eid value.

#### 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

Prev | Up | Next
DbEnv::repmgr_site() | Home | DbEnv::repmgr_site_list()