Getting Started with Berkeley DB, Java Edition High Availability Applications

Legal Notice

This documentation is distributed under an open source license. You may review the terms of this license at:

Oracle, Berkeley DB, Berkeley DB Java Edition and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Oracle.

Java™ and all Java-based marks are a trademark or registered trademark of Sun Microsystems, Inc, in the United States and other countries.

Other names may be trademarks of their respective owners.

To obtain a copy of this document's original source code, please submit a request to the Oracle Technology Network forum at:


Table of Contents

Conventions Used in this Book
For More Information
Contact Us
1. Introduction
Replication Group Members
Replicated Environments
Selecting a Master
Replication Streams
Managing Data Guarantees
Managing Data Consistency
Replication Group Life Cycle
Node States
New Replication Group Startup
Subsequent Startups
Replica Startup
Master Failover
Two Node Groups
2. Replication API First Steps
Using Replicated Environments
Configuring Replicated Environments
HA Exceptions
Master-Specific HA Exceptions
Replica-Specific HA Exceptions
Replicated Environment Handle-Specific Exceptions
Opening a Replicated Environment
Managing Write Requests at a Replica
Using the StateChangeListener
Catching ReplicaWriteException
Secondary Nodes
Time Synchronization
Configuring Two-Node Groups
3. Transaction Management
Managing Durability
Durability Controls
Commit File Synchronization
Managing Acknowledgements
Managing Consistency
Setting Consistency Policies
Time Consistency Policies
Commit Point Consistency Policies
Write Availability
Read Availability
Consistency and Durability Use Cases
Out on the Town
Bio Labs, Inc
Managing Transaction Rollbacks
Example Run Transaction Class
RunTransaction Class
Using RunTransaction
4. Utilities
Administering the Replication Group
Listing Group Members
Locating the Current Master
Adding and Removing Nodes from the Group
Restoring Log Files
Backing up a Replicated Application
Converting Existing Environments for Replication
5. Writing Monitor Nodes
Monitor Class
Listening for Events
6. Replication Examples
7. Administration
Time Synchronization
Node Configuration
Running Backups
Adding and Removing Nodes
Upgrading a JE Replication Group
Upgrade Process
Things To Remember While Upgrading
Handling Problems While Upgrading
Resetting a Replication Group
A. Managing a Failure of the Majority
Overriding the Electable Group Size
Setting the Override
Restoring the Default State
Override Example