Getting Started with Berkeley DB XML 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, Berkeley DB XML 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.

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
1. Introduction
Why Transactions?
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 Container
Opening Berkeley DB Databases
3. Transaction Basics
Committing a Transaction
Non-Durable Transactions
Aborting a Transaction
Auto Commit
Nested Transactions
Using BDB XML Transactions with Berkeley DB Transactions
Configuring the Transaction Subsystem
4. Concurrency
Which BDB XML Handles are Free-Threaded
Locks, Blocks, and Deadlocks
The Locking Subsystem
Configuring the Locking Subsystem
Configuring Deadlock Detection
Resolving Deadlocks
Supported Degrees of Isolation
Reading Uncommitted Data
Committed Reads
Using Snapshot Isolation
No Wait on Blocks
Explicit Transactions on Reads
5. Managing BDB XML 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
Transaction Example
The writerThread Function
In-Memory Transaction Example
Runtime Analysis
Default Program Run
Varying the Node Size
Using Wholedoc Storage
Using Read Committed Isolation
Read Committed with Wholedoc Storage