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
For your chosen project, you need to identify the current problem that you wish your project to solve.  Produce a Problem Statement.  The Problem Statement should explain the purpo

Explain the challenges before an E-business management.


Define Deadlock prevention These protocols make sure that the system will never enter a deadlock state. There are two methods to deadlock prevention. One approach makes sure t

Project Description: We have an encrypted HSQL Database which we want to change into csv format. HSQL DB . We have java application (jar file) which reads that database but n

We will explain here an example database application having COLLEGE database and use it in showing several E-R modelling concepts. College database remains track of faculty, Stu

Data Base Management System 1. Draw the Architecture of MySQL and explain about its subsystems briefly. 2. Elaborate with the help of an example the concept of Primary key a

Describe the responsibilities of the DBA and the database designer ? The responsibilities of DBA and database designer are: 1. Planning for the database's future storage needs

For each m:n relationship type R, we make a new table (say S) to represent R. We also contain the primary key attributes of both the participating entity types as a foreign key att