a question for all

  • hello everyone, plz read the scenerio:::

    Consider a database system that supports an e-commerce website selling books. The database keeps track of the number of copies available of each book title and of the orders that customers have placed. Customers choose books during a session, and at the end place an order and pay for it.

    Few fellows are insisting on not using Transactions to develop this system. How I  convince them to use Transactions. Briefly describe in this context the four ACID properties of transactions. First, give the name of each property and say what it means. Then give an example that illustrates a problem that may occur if the property is not supported.

    kindly reply me .

    Thanx in advance.

  • This was taken from Books Online in SQL Server 2005. Just have a read on this hope this mite help u.

    A transaction is a sequence of operations performed as a single logical unit of work. A logical unit of work must exhibit four properties, called the atomicity, consistency, isolation, and durability (ACID) properties, to qualify as a transaction.

    Atomicity

    A transaction must be an atomic unit of work; either all of its data modifications are performed, or none of them is performed.

    Consistency

    When completed, a transaction must leave all data in a consistent state. In a relational database, all rules must be applied to the transaction's modifications to maintain all data integrity. All internal data structures, such as B-tree indexes or doubly-linked lists, must be correct at the end of the transaction.

    Isolation

    Modifications made by concurrent transactions must be isolated from the modifications made by any other concurrent transactions. A transaction either recognizes data in the state it was in before another concurrent transaction modified it, or it recognizes the data after the second transaction has completed, but it does not recognize an intermediate state. This is referred to as serializability because it results in the ability to reload the starting data and replay a series of transactions to end up with the data in the same state it was in after the original transactions were performed.

    Durability

    After a transaction has completed, its effects are permanently in place in the system. The modifications persist even in the event of a system failure.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • "Then give an example that illustrates a problem that may occur if the property is not supported"

    Using the Northwind example database, consider the following three SQL fragments:

    1. Insert into Orders (columns) values (...)

    2. Insert into [order Details] (columns) values (...)

    3.

    Update Products

    set UnitsInStock = UnitsInStock - ? -- less units ordered

    where ProductId = ? -- product ordered

    If transactions are not used, then when a problem occurs such as SQL Server goes down, disk drives become unavailable, the Application goes down, the Application has an error, or there is a network error, the following can occur:

    a. If statement 1 completes but statements 2 is never executed, you have a order with no products ordered.

    b. If statements 1 and 2 both complete but statements 3 is never executed, you have a order with products but the UnitsInStock is incorrect.

    SQL = Scarcely Qualifies as a Language

  • Wow...doesn't that sound like a homework question!!!!!!!!!

    -SQLBill

  • just read the below link it gives u a brief about transactions

    http://www.sqlservercentral.com/columnists/dpeterson/allabouttransactionspart3.asp

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • SQLBill .... My thoughts exactly

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply