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
Describe disk manager and their work? Disk Manager: Responsible for fetching data regulated through file Manager from disk storage within Main memory and deciding what data to

Creation of Indexes Automatically: When a primary key or Unique constraint is show in a table definition then a unique index is formed automatically. Manually: User can

What are the several forms of identity? a) Value b) Name c) Built-in

Horizontal Fragmentation- Horizontal fragmentation groups together the tuples in a relation that are collectively used by the main transactions. A horizontal fragment is produced b

Give the levels of data abstraction? There are three levels of Data Abstraction a) Physical level b) logical level c) view level

What is the difference between SQL Server 2000 complete and differential backups? A complete backup makes a copy of the whole database. A differential backup creates a copy of

Define entity integrity and referential integrity.  How does SQL allow specification of  these? Ans: Entity Integrity Rule- If the attribute A of relation R is a prime attribut

Define Query by Example QBE is a query language relies upon domain calculus and has two dimensional syntax. The queries are written in the horizontal and vertical dimensions of

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

Project Description: This is going to be a School portal to handle each activities in school such as, School fees payment, online registration and every other payment, course re