<xml></xml>

Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

Berkeley DB .NET API Documentation
DatabaseEnvironment..::.RepMgrStartMaster Method
DatabaseEnvironment Class See Also Send Feedback

Start the replication manager as a master site, and do not call for an election.

Namespace: BerkeleyDB
Assembly: libdb_dotnet53 (in libdb_dotnet53.dll) Version: 5.3.21.0

# Syntax

C#

    public void RepMgrStartMaster(
    	int nthreads
    )

Visual Basic (Declaration)

    Public Sub RepMgrStartMaster ( _
    	nthreads As Integer _
    )

Visual C++

    public:
    void RepMgrStartMaster(
    	int nthreads
    )

#### Parameters

nthreads
  Type: System..::.Int32
  Specify the number of threads of control created and dedicated to processing replication messages. In addition to these message processing threads, the replication manager creates and manages a few of its own threads of control.

# Remarks

There are two ways to build Berkeley DB replication applications: the most common approach is to use the Berkeley DB library "replication manager" support, where the Berkeley DB library manages the replication group, including network transport, all replication message processing and acknowledgment, and group elections. Applications using the replication manager support generally make the following calls:

1. Configure the local site in the replication group, RepMgrLocalSite.
2. Call RepMgrSiteConfig(DbSiteConfig) to configure the remote site(s) in the replication group.
3. Configure the message acknowledgment policy (RepMgrAckPolicy) which provides the replication group's transactional needs.
4. Configure the local site's election priority, RepPriority.
5. Call RepMgrStartClient(Int32) or RepMgrStartMaster(Int32) to start the replication application.

For more information on building replication manager applications, please see the Replication Getting Started Guide included in the Berkeley DB documentation.

Applications with special needs (for example, applications using network protocols not supported by the Berkeley DB replication manager), must perform additional configuration and call other Berkeley DB replication methods. For more information on building advanced replication applications, please see the Base Replication API section in the Berkeley DB Programmer's Reference Guide for more information.

Starting the replication manager consists of opening the TCP/IP listening socket to accept incoming connections, and starting all necessary background threads. When multiple processes share a database environment, only one process can open the listening socket; RepMgrStartMaster(Int32) (and RepMgrStartClient(Int32)) automatically open the socket in the first process to call it, and skips this step in the later calls from other processes.

# See Also

DatabaseEnvironment Class
BerkeleyDB Namespace