Java DB

Apache Derby

Derby Developer's Guide

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Developer's Guide
-After installing
-Upgrades
-JDBC applications and Derby basics
-Application development overview
-Derby embedded basics
-Derby JDBC driver
-Derby JDBC database connection URL
-Derby system
-A Derby database
-Connecting to databases
-Working with the database connection URL attributes
-Using in-memory databases
-Working with Derby properties
-Deploying Derby applications
-Deployment issues
-Creating Derby databases for read-only use
-Loading classes from a database
-Derby server-side programming
-Programming database-side JDBC routines
-Programming trigger actions
-Programming Derby-style table functions
-Programming user-defined types
-Controlling Derby application behavior
-The JDBC connection and transaction model
-Result set and cursor mechanisms
-Locking, concurrency, and isolation
-Working with multiple connections to a single database
-Working with multiple threads sharing a single connection
-Working with database threads in an embedded environment
-Working with Derby SQLExceptions in an application
-Using Derby as a J2EE resource manager
-Derby and Security
-Configuring security for your environment
-Working with user authentication
-Users and authorization identifiers
-User authorizations
-Encrypting databases on disk
-Signed jar files
-Notes on the Derby security features
-User authentication and authorization examples
-Running Derby under a security manager
-Developing tools and using Derby with an IDE
-SQL tips
-Localizing Derby
-Derby and standards

 

Configuring deadlock detection and lock wait timeouts

You configure the amount of time a transaction waits before Derby does any deadlock checking with the derby.locks.deadlockTimeout property.

You configure the amount of time a transaction waits before timing out with the derby.locks.waitTimeout property. When configuring your database or system, you should consider these properties together. For example, in order for any deadlock checking to occur, the derby.locks.deadlockTimeout property must be set to a value lower than the derby.locks.waitTimeout property. If it is set to a value equal to or higher than the derby.locks.waitTimeout, the transaction times out before Derby does any deadlock checking.

By default, derby.locks.waitTimeout is set to 60 seconds. -1 is the equivalent of no wait timeout. This means that transactions never time out, although Derby can choose a transaction as a deadlock victim.

Figure 1. One possible configuration: deadlock checking occurs when a transaction has waited 30 seconds; no lock wait timeouts occur.
This figure shows a configuration
where deadlock checking occurs when a transaction has waited 30 seconds. No
lock wait timeouts occur.
Figure 2. Another typical configuration: deadlock checking occurs after a transaction has waited 60 seconds for a lock; after 90 seconds, the transaction times out and is rolled back.
This figure shows a configuration
where deadlock checking occurs after a transaction has waited 60 seconds for
a lock. After 90 seconds, the transaction times out and is rolled back.
Figure 3. A configuration in which no deadlock checking occurs: transactions time out after they have waited 50 seconds. No deadlock checking occurs.
This figure shows a configuration
where no deadlock checking occurs. The transactions time out after they have
waited 50 seconds. No deadlock checking occurs.
 

javadb@jdbcurl.com