Example of transaction? , Database Management System

Assignment Help:

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.


Related Discussions:- Example of transaction?

In which format database schema is written, In which format database schema...

In which format database schema is written ? Data base schema is written in the DDL format.

What is meant by heuristic optimisation, What is meant by heuristic optimis...

What is meant by heuristic optimisation?  Discuss the main heuristics that are applied during query optimisation.  Ans:  In heuristic optimization, heuristics are employed to r

What is a name, What is a Name? A user-supplied name is used for identi...

What is a Name? A user-supplied name is used for identity. This form of identity is used for files in file systems. The user gives every file a name that uniquely identifies it

Dbms built for online transaction processing, Problem: A DBMS built for...

Problem: A DBMS built for Online Transaction Processing (OLTP) is usually regarded as unsuitable for data warehousing. Each system is designed with a different set of requireme

Explain transaction manager and their work, Explain Transaction manager and...

Explain Transaction manager and their work? Transaction Manager: Ensure the database remains in a constant (correct) state despite system failure, and in which concurrent trans

Define the one-way associations, One-way Associations When an associat...

One-way Associations When an association is traversed only in the one direction, then it is implemented as a pointer i.e.an attribute which contains an object reference. If mu

What is the used of specifying alias, What is the used of specifying alias?...

What is the used of specifying alias? Specifying alias: is used to rename column or attribute in a table.

Entity relationship diagram, The Enhanced Entity Relationship Diagram (ERD)...

The Enhanced Entity Relationship Diagram (ERD) produced with a drawing or case tool. Your EERD must use a ''standard'' notation style such as Crows Foot or Chen. Please note that t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd