JavaJEEJTA: Difference between revisions
(New page: ==Introduction== Properties of a database transaction are: * atomicity (all task of a transaction or none) * consistency (consistent before and after a transaction) * isolation (serializab...) |
|||
| Line 1: | Line 1: | ||
== | ==Basics== | ||
Properties of a database transaction are: | Properties of a database transaction are: | ||
* atomicity (all task of a transaction or none) | * atomicity (all task of a transaction or none) | ||
| Line 5: | Line 5: | ||
* isolation (serializable) | * isolation (serializable) | ||
* durability (transaction comitted its persistent) | * durability (transaction comitted its persistent) | ||
XA describes the interface between the global transaction manager and the local resource manager. Multiple resources can be accessed within the same transaction (ACID across applications). | |||
Two-phase commit describes one coordinator and n cohorts. | |||
1. Coordinator send a query to commit to all cohorts. | |||
2. cohorts write undo and redo log | |||
3. cohorts answer with agreement or abort | |||
4. if one cohort sends abort, coordinator sends rollback to all cohorts, otherwise coordinator sends commit to all cohorts. | |||
==Introduction== | |||
JTA consists of three elements: | |||
* transaction demarcation interface | |||
* transaction manager interface | |||
* Java mapping oth the XA protocol | |||
Revision as of 14:17, 21 July 2008
Basics
Properties of a database transaction are:
- atomicity (all task of a transaction or none)
- consistency (consistent before and after a transaction)
- isolation (serializable)
- durability (transaction comitted its persistent)
XA describes the interface between the global transaction manager and the local resource manager. Multiple resources can be accessed within the same transaction (ACID across applications).
Two-phase commit describes one coordinator and n cohorts. 1. Coordinator send a query to commit to all cohorts. 2. cohorts write undo and redo log 3. cohorts answer with agreement or abort 4. if one cohort sends abort, coordinator sends rollback to all cohorts, otherwise coordinator sends commit to all cohorts.
Introduction
JTA consists of three elements:
- transaction demarcation interface
- transaction manager interface
- Java mapping oth the XA protocol