JavaJEEJTA

From Wiki RB4

Basics[edit]

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[edit]

JTA consists of three elements:

  • transaction demarcation interface
  • transaction manager interface
  • Java mapping oth the XA protocol