Writing Transactional Applications with Berkeley DB, Java Edition

Legal Notice

This documentation is distributed under the terms of the Sleepycat public license. You may review the terms of this license at: http://www.sleepycat.com/download/oslicense.html

Sleepycat Software, Berkeley DB, Berkeley DB XML and the Sleepycat logo are trademarks or service marks of Sleepycat Software, Inc. All rights to these marks are reserved. No third-party use is permitted without the express prior written consent of Sleepycat Software, Inc.

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

To obtain a copy of this document's original source code, please write to .

5/24/2006


Table of Contents

Preface
Conventions Used in this Book
For More Information
1. Introduction
Transaction Benefits
A Note on System Failure
Application Requirements
Multi-threaded Applications
Recoverability
Performance Tuning
2. Enabling Transactions
Opening a Transactional Environment and Database
3. Transaction Basics
Committing a Transaction
Non-Durable Transactions
Aborting a Transaction
Auto Commit
Transactional Cursors
Secondary Indices with Transaction Applications
Configuring the Transaction Subsystem
4. Concurrency
Which JE Handles are Free-Threaded
Locks, Blocks, and Deadlocks
Locks
Blocks
Deadlocks
JE Lock Management
Managing JE Lock Timeouts
Managing Deadlocks
Isolation
Supported Degrees of Isolation
Reading Uncommitted Data
Committed Reads
Configuring Serializable Isolation
Transactional Cursors and Concurrent Applications
Using Cursors with Uncommitted Data
Read/Modify/Write
5. Backing up and Restoring Berkeley DB, Java Edition Applications
Normal Recovery
Checkpoints
Performing Backups
Performing a Hot Backup
Performing an Offline Backup
Using the DbBackup Helper Class
Performing Catastrophic Recovery
Hot Failover
6. Summary and Examples
Anatomy of a Transactional Application
Transaction Example
TxnGuide.java
PayloadData.java
DBWriter.java