dimanche 28 octobre 2007

Degrees of isolation (degrees of Consistency)

Degrees of isolation:

degree 0 - a transaction does not overwrite data updated by another user or process ("dirty data") of other transactions

degree 1 - degree 0 plus a transaction does not commit any writes until it completes all its writes (until the end of transaction)

degree 2 - degree 1 plus a transaction does not read dirty data from other transactions

degree 3 - degree 2 plus other transactions do not dirty data read by a transaction before the transaction commits

Serializability

An important concept to understanding isolation through transactions is serializability. Transactions are serializable when the effect on the database is the same whether the transactions are executed in serial order or in an interleaved fashion.

Concurrent Transactions

Concurrent transactions are transactions that occur at the same time, such as shared multiple users accessing shared objects.

As an example, if two people are updating the same catalog item, it's not acceptable for one person's changes to be "clobbered" when the second person saves a different set of changes. Both users should be able to work in isolation, working as though he or she is the only user. Each set of changes must be isolated from those of the other users.

Isolation and ACID properties

The isolation portion of the ACID properties is needed when there are concurrent transactions. The safeguards used by a DBMS to prevent conflicts between concurrent transactions are a concept referred to as isolation.

samedi 27 octobre 2007

Java Transaction Design Strategies



Understanding how transaction management works in Java and developing an effective transaction design strategy can help to avoid data integrity problems in your applications and databases and ease the pain of inevitable system failures.

This book is about how to design an effective transaction management strategy using the transaction models provided by Java-based frameworks such as EJB and Spring. Techniques, best practices, and pitfalls with each transaction model will be described. In addition, transaction design patterns will bring all these concepts and techniques together and describe how to use these models to effectively manage transactions within your EJB or Spring-based Java applications.

UserTransaction Interface

The UserTransaction interface defines the methods that allow an application to explicitly manage transaction boundaries.

TransactionManager Interface

The TransactionManager interface defines the methods that allow an application server to manage transaction boundaries.