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: http://www.oracle.com/technetwork/database/berkeleydb/downloads/oslicense-093458.html

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: http://forums.oracle.com/forums/forum.jspa?forumID=271

5/11/2012


Table of Contents

Preface
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
Recoverability
Performance Tuning
2. Enabling Transactions
Environments
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
Locks
Blocks
Deadlocks
The Locking Subsystem
Configuring the Locking Subsystem
Configuring Deadlock Detection
Resolving Deadlocks
Setting Transaction Priorities
Isolation
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
Read/Modify/Write
No Wait on Blocks
Reverse BTree Splits
5. Managing DB Files
Checkpoints
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
TxnGuide.java
PayloadData.java
DBWriter.java
DPL Transaction Example
TxnGuide.java
PayloadDataEntity.java
StoreWriter.java
Base API In-Memory Transaction Example