Information Technology Reference
In-Depth Information
receiving a response to the message. Because the processes are distinct, it
is also not possible for most MOM products to encapsulate the sending of a
message and the receiving of that same message into one transaction—the
transactional context is lost once the message has been sent to the des-
tination. This is a result of the asynchronous, loosely coupled nature of
messaging.
An approach to implementing transactional scope across the sending and
receiving messaging clients is for the programmer to include a compensat-
ing transaction in the application logic. For instance, if the transaction in the
receiving client fails, a message has to be sent to the sending client to inform
it of the failure. When the sending client receives the message, it has to per-
form a compensating transaction to reverse the original database transaction
it has performed. Due to the asynchronous nature of message queuing, it
is difficult for MOM to maintain ACID properties of transactions. A basic
MOM product does not provide this mechanism, and it has to be custom
developed.
A transaction represents a sequence of database operations
(insert, update, delete, select) for which the system guarantees
four properties also known as Atomicity, Consistency, Isolation,
and Durability (ACID):
• Atomicity : A transaction is executed completely or not at all,
thus exhibiting the characteristics of atomicity. As a con-
sequence, all changes to the data made by this transaction
become visible only if the transaction reaches commit success-
fully. Otherwise, if the transaction was terminated abnormally
before reaching a commit, the original state of the data from
the beginning is restored.
• Consistency : The property of consistency guarantees that all
defined integrity or consistency constraints are preserved at
the end of a transaction, that is, a transaction always moves the
database from one consistent state to another consistent state.
This has two consequences: In case a consistency constraint is
violated, the transaction may be abnormally terminated and
secondly, constraints can be temporarily violated during trans-
action execution but must be preserved upon the commit.
• Isolation : A transaction behaves as if it runs alone on the data-
base without any concurrent operations. Furthermore, it only
sees effects from previously committed transactions.
• Durability : When a transaction reaches the commit, it is guar-
anteed that all changes made by this transaction will survive
subsequent system and disk failures.
 
Search WWH ::




Custom Search