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




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
1) Define a job scheduling strategy that will meet business requirement of reporting availability by 6am CST for the following cubes? Show the job scheduling dependencies in a pict

Section A:  Use the following tables to create a database called College.  Use SQL commands. Student stuid(primary) lastName firstName

What is meant by data-transfer rate? The data-transfer rate is the rate at which data can be retrieved from or kept to the disk.

What is a super key? A super key is a set of one or more attributes that collectively permits us to recognize uniquely an entity in the entity set.

.#question. Discuss the problem which may arise during concurrency control and recovery in distributed database which are not encountered in controlized database environment.

Question 1 Discuss the classification of DBMS based on location of database Question 2 Explain with examples different SQL commands used for creating and deleting relations.

What are the advantages and disadvantages of merging an association into a class?  Advantages: i)  Less number of tables ii) Faster performance due to the fewer tables

A Relation Schema represented by R(A1, A2, ..., An) is made up of the relation name the list of attributes and R Ai that it contains. A relation is described as a set of tuples

Give the general form of SQL query? Select  A1, A2............., An From  R1, R2..............., Rm Where  P