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?

Explain hashing techniques, Explain Hashing techniques The hashing tech...

Explain Hashing techniques The hashing techniques can be categorized as: Static Hashing Techniques - In this method, the data can be viewed a collection of buckets, along with

Having clause-data manipulation language, Having clause This clause...

Having clause This clause is used for producing conditions on grouped information. Example: Find maximum salary and department number of those departments where maxim

What is conceptual model, What is conceptual model ? A conceptual model...

What is conceptual model ? A conceptual model is a independent of both hardware and software.

For known, What are the function of DBA?

What are the function of DBA?

The natural join is equal to which product, The natural join is equal to wh...

The natural join is equal to which product? The natural join is equal to Combination of projection and Cartesian product

Explain the dependency relationship of object oriented, Explain the depende...

Explain the dependency relationship of object oriented A dependency is a relationship which states that a change in specification of one thing can affect another thing, but n

Icloud based storage, Advantages and disadvantages of icloud based storage

Advantages and disadvantages of icloud based storage

aggregate functions-data manipulation language, Aggregate functions ...

Aggregate functions Some of these functions are min, count, max, and avg. These functions help in getting consolidated information from a set of tuples. Example:

Mention the several levels in security measures, Mention the several levels...

Mention the several levels in security measures. A) Database system B) Operating system C) Network D) Physical Human

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