Example of transaction? , Database Management System

Example:; transfers transfer_amount from x's account to y's account

; Supposes x&y both accounts exist

TRANSACTION (x, y, transfer_amount)

Start transaction

IF X AND Y exist then

READ x.balance

IF x.balance > transfer_amount THEN

x.balance = x.balance - transfer_amount

READ y.balance

y.balance = y.balance + transfer_amount

COMMIT

ELSE DISPLAY ("BALANCE IN X NOT OK") ROLLBACK

ELSE DISPLAY ("ACCOUNT X OR Y DOES NOT EXIST") End_transaction

Please note the use of 2 keywords here COMMIT and ROLLBACK. Commit makes sure that all the modifications made by transactions are made permanent. ROLLBACK ends the transactions and discards any change made by the transaction. Transactions have definite desirable properties. Let us see into those properties of a transaction.

Posted Date: 3/11/2013 5:19:23 AM | Location : United States







Related Discussions:- Example of transaction? , Assignment Help, Ask Question on Example of transaction? , Get Answer, Expert's Help, Example of transaction? Discussions

Write discussion on Example of transaction?
Your posts are moderated
Related Questions
You will be analysing a set of financial data of your choice. It is not necessary to collect any primary data of your own, and publicly available secondary data will be sufficient

A database to track your progress in your college program will track your progress towards graduation! A database that has information containing the classes that you have taken, c

Consider the following frequency counts of some itemsets in a transaction database r : freq({A}, r) = 0.405 freq({B}, r) = 0.510 freq({C}, r) = 0.303 freq({A

The cross-section of twisted pair The cross-section of each and every strand of the twisted pair is π/4 square mm. A 10-km length of this type of material, with two strands per

Saving Derived Attributes to Avoid Re-computation   As discussed, "redundancy means duplication of exact data". But, if multiple copies of same data are present in the system,

What is trigger Triggers are statements that are implemented automatically by the system as the side effect of a change to the database.

Boyce-Code Normal Form (BCNF) A relationship is said to be in BCNF if it is already in 3NF and the left hand side of each dependency is a candidate key. A relation who is in 3N

Using Relational Algebra which query finds customers, who have a balance of over 1000 ? Using Relational Algebra Π Customer_name( σ balance >1000(Deposit)) is query to find cu

What are the failures of Controlling Events Between Objects  Failure Unintentional termination of system. Several possible causes: failure of system hardware, o

What is recovery management component? Ensuring durability is the responsibility of a software component of the base system known as the recovery management component.