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
What is the main goal of RAID technology? Describe the levels 1 through 5. RAID stands for Redundant Array of Inexpensive (or sometimes "Independent")Disks. RAID is a met

1. Design the logic, using a looping structure, for a program that outputs every even number from 1 through 25 along with its square and cube. 2. Mr. Sanchez owns 12 apartme

find the name of supplier who supply some red part

Define Timestamp ordering Ans In timestamp-based method, a serial order is made among the concurrent transaction by assigning to every transaction a unique nondecreasing number

This assignment is worth 45% of your final grade for this module.  Marks will be awarded as follows: Prototypes (wireframe and web based prototype) You are expected

Increased parallelism : Since the replicated date has several copies a query can be distributed or can be answered from the smallest loaded site. Also, with more replicas you have


What is called a query -execution engine? The query implementation engine takes a query evaluation plan, implements that plan, and returns the answers to the query.

Define DBA database administrator? DBA : A database administrator (DBA) is a person who is responsible for the environmental aspects of a database. In common, these involves:

QUESTION (a)(i) Define the term database. (ii) How is it different from a database management system? (b) What is the difference between an entity and an attribute? (c