Sophie

Sophie

distrib > Mandriva > 2007.0 > x86_64 > media > main-release > by-pkgid > a4c98df40e78f6c892308fd6841f950a > files > 357

lib64db4.2-devel-4.2.52-11mdv2007.0.x86_64.rpm

<!--$Id: rep_transport.so,v 1.30 2003/11/19 04:07:41 bostic Exp $-->
<!--Copyright 1997-2003 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DbEnv::set_rep_transport</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<a name="2"><!--meow--></a>
<table width="100%"><tr valign=top>
<td>
<h3>DbEnv::set_rep_transport</h3>
</td>
<td align=right>
<a href="../../db42-devel-4.2.52/api_cxx/api_index.html"><img src="../../db42-4.2.52/images/api.gif" alt="API"></a>
<a href="../../db42-devel-4.2.52/ref/toc.html"><img src="../../db42-4.2.52/images/ref.gif" alt="Ref"></a>
</td></tr></table>
<hr size=1 noshade>
<tt>
<h3><pre>
#include &lt;db_cxx.h&gt;
<p>
int
DbEnv::set_rep_transport(int envid,
    int (*send)(DB_ENV *dbenv,
    const Dbt *control, const Dbt *rec, const DbLsn *lsnp,
    int envid, u_int32_t flags));
</pre></h3>
<hr size=1 noshade>
<h3>Description: DbEnv::set_rep_transport</h3>
<p>The DbEnv::set_rep_transport method initializes the communication infrastructure
for a database environment participating in a replicated application.</p>
<p>The DbEnv::set_rep_transport method configures operations performed using the specified
<a href="../../db42-devel-4.2.52/api_cxx/env_class.html">DbEnv</a> handle, not all operations performed on the underlying
database environment.</p>
<p>The DbEnv::set_rep_transport method may be called at any time during the life of the
application.</p>
<p>The DbEnv::set_rep_transport 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.
</p>
<h3>Parameters</h3>
<p><dl compact>
<p><dt><b>envid</b><dd>
The <b>envid</b> parameter is the local environment's ID.  It must be
a positive integer and uniquely identify this Berkeley DB database environment
(see <a href="../../db42-devel-4.2.52/ref/rep/id.html">Replication environment IDs</a> for more
information).
<p><dt><b>send</b><dd>
The <b>send</b> callback function is used to transmit data using the
replication application's communication infrastructure.  The parameters
to <b>send</b> are as follows:
<p><dl compact>
<p><dt><b>dbenv</b><dd>The <b>dbenv</b> parameter is the enclosing database environment handle.
<p><dt><b>control</b><dd>The <b>control</b> parameter is the first of the two data elements to be
transmitted by the <b>send</b> function.
<p><dt><b>rec</b><dd>The <b>rec</b> parameter is the second of the two data elements to be
transmitted by the <b>send</b> function.
<p><dt><b>lsnp</b><dd>If the type of message to be sent has an LSN associated with it, then
the <b>lsnp</b> parameter
contains the LSN of the record being sent.  This LSN can be used to
determine that certain records have been processed successfully by
clients.
<p><dt><b>envid</b><dd>The <b>envid</b> parameter is a positive integer identifier that
specifies the replication environment to which the message should be
sent (see <a href="../../db42-devel-4.2.52/ref/rep/id.html">Replication environment IDs</a> for
more information).
<a name="3"><!--meow--></a>
<p>The special identifier DB_EID_BROADCAST indicates that a message
should be broadcast to every environment in the replication group.  The
application may use a true broadcast protocol or may send the message
in sequence to each machine with which it is in communication.  In both
cases, the sending site should not be asked to process the message.</p>
<p><dt><b>flags</b><dd>The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one
or more of the following values:
<p><dl compact>
<p><dt><a name="DB_REP_NOBUFFER">DB_REP_NOBUFFER</a><dd>The record being sent should be transmitted immediately and not buffered
or delayed.
<p><dt><a name="DB_REP_PERMANENT">DB_REP_PERMANENT</a><dd>The record being sent is critical for maintaining database integrity
(for example, the message includes a transaction commit).  The
application should take appropriate action to enforce the reliability
guarantees it has chosen, such as waiting for acknowledgement from one
or more clients.
</dl>
</dl>
<p>It may sometimes be useful to pass application-specific data to the
<b>send</b> function; see <a href="../../db42-devel-4.2.52/ref/env/faq.html">Environment
FAQ</a> for a discussion on how to do this.</p>
The <b>send</b> function should not call back down into Berkeley DB.  The
<b>send</b> function must return 0 on success and non-zero on failure.
If the <b>send</b> function fails, the message being sent is necessary
to maintain database integrity, and the local log is not configured for
synchronous flushing, the local log will be flushed; otherwise, any
error from the <b>send</b> function will be ignored.
</dl>
<h3>Errors</h3>
<p>The DbEnv::set_rep_transport method
may fail and throw
<a href="../../db42-devel-4.2.52/api_cxx/except_class.html">DbException</a>,
encapsulating one of the following non-zero errors, or return one of
the following non-zero errors:</p>
<p><dl compact>
<p><dt>EINVAL<dd>An
invalid flag value or parameter was specified.
</dl>
<hr size=1 noshade>
<h3>Class</h3>
<a href="../../db42-devel-4.2.52/api_cxx/env_class.html">DbEnv</a>
<h3>See Also</h3>
<a href="../../db42-devel-4.2.52/api_cxx/rep_list.html">Replication and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../../db42-devel-4.2.52/api_cxx/api_index.html"><img src="../../db42-4.2.52/images/api.gif" alt="API"></a><a href="../../db42-devel-4.2.52/ref/toc.html"><img src="../../db42-4.2.52/images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1><a href="../../db42-devel-4.2.52/sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>
</body>
</html>