Getting Started with Berkeley DB Transaction Processing

Legal Notice

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

Oracle, Berkeley DB, 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
Transaction Benefits
A Note on System Failure
Application Requirements
Multi-threaded and Multi-process Applications
Performance Tuning
2. Enabling Transactions
File Naming
Error Support
Shared Memory Regions
Security Considerations
Opening a Transactional Environment and Store or Database
3. Transaction Basics
Committing a Transaction
Non-Durable Transactions
Aborting a Transaction
Auto Commit
Nested Transactions
Transactional Cursors
Using Transactional DPL Cursors
Secondary Indices with Transaction Applications
Configuring the Transaction Subsystem
4. Concurrency
Which DB Handles are Free-Threaded
Locks, Blocks, and Deadlocks
The Locking Subsystem
Configuring the Locking Subsystem
Configuring Deadlock Detection
Resolving Deadlocks
Setting Transaction Priorities
Supported Degrees of Isolation
Reading Uncommitted Data
Committed Reads
Using Snapshot Isolation
Transactional Cursors and Concurrent Applications
Using Cursors with Uncommitted Data
Exclusive Database Handles
No Wait on Blocks
Reverse BTree Splits
5. Managing DB Files
Backup Procedures
About Unix Copy Utilities
Offline Backups
Hot Backup
Incremental Backups
Recovery Procedures
Normal Recovery
Catastrophic Recovery
Designing Your Application for Recovery
Recovery for Multi-Threaded Applications
Recovery in Multi-Process Applications
Using Hot Failovers
Removing Log Files
Configuring the Logging Subsystem
Setting the Log File Size
Configuring the Logging Region Size
Configuring In-Memory Logging
Setting the In-Memory Log Buffer Size
6. Summary and Examples
Anatomy of a Transactional Application
Base API Transaction Example
DPL Transaction Example
Base API In-Memory Transaction Example