Berkeley DB
version 4.2.52

com.sleepycat.db
Interface DbRepTransport


public interface DbRepTransport

An interface specifying a replication transmit function, which sends information to other members of the replication group.


Method Summary
 int send(DbEnv dbenv, Dbt control, Dbt rec, DbLsn lsn, int flags, int envid)
          The DbRepTransport interface is used by the DbEnv.setReplicationTransport method.
 

Method Detail

send

public int send(DbEnv dbenv,
                Dbt control,
                Dbt rec,
                DbLsn lsn,
                int flags,
                int envid)
         throws DbException
The DbRepTransport interface is used by the DbEnv.setReplicationTransport method. This interface defines the application-specific function to be called during transaction abort and recovery.

It may sometimes be useful to pass application-specific data to the send function; see Environment FAQ for a discussion on how to do this.

Parameters:
dbenv - the enclosing database environment handle.
control - the first of the two data elements to be transmitted by the send function.
rec - the second of the two data elements to be transmitted by the send function.
lsn - If the type of message to be sent has an LSN associated with it, then the lsn 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.
envid - a positive integer identifier that specifies the replication environment to which the message should be sent (see Replication environment IDs for more information).
  • Db.DB_EID_BROADCAST

    The special identifier Db.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.

flags - must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
  • Db.DB_REP_NOBUFFER

    The record being sent should be transmitted immediately and not buffered or delayed.

  • Db.DB_REP_PERMANENT

    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.

Returns:
The send function should not call back down into Berkeley DB. The send function must return 0 on success and non-zero on failure. If the send 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 send function will be ignored.

Throws:
DbException - Signals that an exception of some sort has occurred.

Berkeley DB
version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.