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
Do you have experts of the dbms

Write short notes on tuple relational calculus. The tuple relational calculation is anon procedural query language. It defines the desired information without giving a particul

Object Oriented model :An object has values stored in instance variables within the object. An object also has bodies of code that execute on the object. These bodies of code are

Question: (a) One of the steps in the five-step problem-solving model is implementation. Implementation is considered a key step in the problem-solving model. A problem may be

1 NF Normal Form The domain of attribute must add only atomic (simple, indivisible) values First normal form (Minimal Form or 1NF) is a normal form need in database normalizat

What is a view? A view is a logical view on one or more tables.  A view on one or more tables i.e., the data from a view is not actually physically kept instead being derived f

What are the categories of SQL command? SQL commands are separated in to the following categories: 1. Data - Definitition Language 2. Data Manipulation language 3. Dat

what is bogus empowerment. And what is genuine empowerment

Use of partial data by applications : In common, applications work with views rather than whole relations. Thus, it may be more appropriate to work with subsets of relations rather

What is SQL, and why is it important? SQL stands for Structured Query Language, and is the most significant data processing language in use today. It is not a complete programm