2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DB_ENV->set_rep_transport</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DB_ENV->set_rep_transport</h1>
18
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
26
DB_ENV->set_rep_transport(DB_ENV *env, int envid,
27
int (*send)(DB_ENV *dbenv,
28
const DBT *control, const DBT *rec, int envid, u_int32_t flags));
31
<p>The DB_ENV->set_rep_transport method initializes the communication infrastructure
32
for a database environment participating in a replicated application.
33
<p>The <b>envid</b> parameter is the local environment's ID. It must be
34
a positive integer and uniquely identify this Berkeley DB database environment
35
(see <a href="../ref/rep/id.html">Replication environment IDs</a> for more
37
<p>The <b>send</b> parameter is a callback interface used to transmit data
38
using the replication application's communication infrastructure. The
39
parameters to <b>send</b> are as follows:
41
<p><dt>dbenv<dd>The enclosing database environment.
42
<p><dt>control<dd>The control parameter is the first of the two data elements to be
43
transmitted by the <b>send</b> interface.
44
<p><dt>rec<dd>The rec parameter is the second of the two data elements to be
45
transmitted by the <b>send</b> interface.
46
<p><dt>envid<dd>The <b>envid</b> parameter is a positive integer identifier that
47
specifies the replication environment to which the message should be
48
sent (see <a href="../ref/rep/id.html">Replication environment IDs</a> for
50
<p><a name="3"><!--meow--></a>
51
The special identifier DB_EID_BROADCAST indicates that a message
52
should be broadcast to every environment in the replication group. The
53
application may use a true broadcast protocol, or may send the message
54
in sequence to each machine with which it is in communication.
56
<p>The <b>flags</b> value must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one or
57
more of the following values:
59
<p><dt><a name="DB_REP_PERMANENT">DB_REP_PERMANENT</a><dd>The record being sent is critical for maintaining database integrity
60
(for example, the message includes a transaction commit). The
61
application should take appropriate action to enforce the reliability
62
guarantees it has chosen, such as waiting for acknowledgement from one
66
<p>The <b>send</b> interface must return 0 on success and non-zero on
67
failure. If the <b>send</b> interface fails, the message being sent
68
is necessary to maintain database integrity, and the local log is not
69
configured for synchronous flushing, the local log will be flushed;
70
otherwise, any error from the <b>send</b> interface will be ignored.
71
<p>It may sometimes be useful to pass application-specific data to the
72
<b>send</b> interface; see <a href="../ref/env/faq.html">Environment
73
FAQ</a> for a discussion on how to do this.
74
<p>The DB_ENV->set_rep_transport method configures operations performed using the specified
75
<a href="../api_c/env_class.html">DB_ENV</a> handle, not all operations performed on the underlying
77
<p>The DB_ENV->set_rep_transport interface may be called at any time during the life of
79
<p>The DB_ENV->set_rep_transport method returns a non-zero error value on failure and 0 on success.
81
<p>The DB_ENV->set_rep_transport method may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
82
If a catastrophic error has occurred, the DB_ENV->set_rep_transport method may fail and
83
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>,
84
in which case all subsequent Berkeley DB calls will fail in the same way.
86
<a href="../api_c/env_class.html">DB_ENV</a>
88
<a href="../api_c/rep_list.html">Replication and Related Methods</a>
90
<table width="100%"><tr><td><br></td><td align=right>
91
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
93
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>