434 captures
05 May 2004 - 26 Jan 2026
Mar APR May
24
2012 2013 2014
success
fail

About this capture

COLLECTED BY

Organization: Internet Archive

The Internet Archive discovers and captures web pages through many different web crawls. At any given time several distinct crawls are running, some for months, and some every day or longer. View the web archive through the Wayback Machine.

Collection: Wide Crawl started April 2013

Web wide crawl with initial seedlist and crawler configuration from April 2013.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20130424101142/http://en.wikipedia.org/wiki/Database_transaction
 



Database transaction

 

From Wikipedia, the free encyclopedia
 

Jump to: navigation, search  

Atransaction comprises a unit of work performed within a database management system (or similar system) against a database, and treated in a coherent and reliable way independent of other transactions. Transactions in a database environment have two main purposes:

  1. To provide reliable units of work that allow correct recovery from failures and keep a database consistent even in cases of system failure, when execution stops (completely or partially) and many operations upon a database remain uncompleted, with unclear status.
  2. To provide isolation between programs accessing a database concurrently. If this isolation is not provided, the program's outcome are possibly erroneous.

A database transaction, by definition, must be atomic, consistent, isolated and durable.[1] Database practitioners often refer to these properties of database transactions using the acronym ACID.

Transactions provide an "all-or-nothing" proposition, stating that each work-unit performed in a database must either complete in its entirety or have no effect whatsoever. Further, the system must isolate each transaction from other transactions, results must conform to existing constraints in the database, and transactions that complete successfully must get written to durable storage.

Contents

[edit] Purpose

Databases and other data stores which treat the integrity of data as paramount often include the ability to handle transactions to maintain the integrity of data. A single transaction consists of one or more independent units of work, each reading and/or writing information to a database or other data store. When this happens it is often important to ensure that all such processing leaves the database or data store in a consistent state.

Examples from double-entry accounting systems often illustrate the concept of transactions. In double-entry accounting every debit requires the recording of an associated credit. If one writes a check for €100 to buy groceries, a transactional double-entry accounting system must record the following two entries to cover the single transaction:

  1. Debit €100 to Groceries Expense Account
  2. Credit €100 to Checking Account

A transactional system would make both entries pass or both entries would fail. By treating the recording of multiple entries as an atomic transactional unit of work the system maintains the integrity of the data recorded. In other words, nobody ends up with a situation in which a debit is recorded but no associated credit is recorded, or vice versa.

[edit] Transactional databases

Atransactional database is a DBMS where write transactions on the database are able to be rolled back if they are not completed properly (e.g. due to power or connectivity loss).

Most modern relational database management systems fall into the category of databases that support transactions.

In a database system a transaction might consist of one or more data-manipulation statements and queries, each reading and/or writing information in the database. Users of database systems consider consistency and integrity of data as highly important. A simple transaction is usually issued to the database system in a language like SQL wrapped in a transaction, using a pattern similar to the following:

  1. Begin the transaction
  2. Execute a set of data manipulations and/or queries
  3. If no errors occur then commit the transaction and end it
  4. If errors occur then rollback the transaction and end it

If no errors occurred during the execution of the transaction then the system commits the transaction. A transaction commit operation applies all data manipulations within the scope of the transaction and persists the results to the database. If an error occurs during the transaction, or if the user specifies a rollback operation, the data manipulations within the transaction are not persisted to the database. In no case can a partial transaction be committed to the database since that would leave the database in an inconsistent state.

Internally, multi-user databases store and process transactions, often by using a transaction ID or XID.

There are multiple varying ways for transactions to be implemented other than the simple way documented above. Nested transactions, for example, are transactions which contain statements within them that start new transactions (i.e. sub-transactions). Multi-level transactions are similar but have a few extra properties[citation needed]. Another type of transaction is the compensating transaction.

[edit] In SQL

SQL is inherently transactional, and a transaction is automatically started when another ends. Some databases extend SQL and implement a START TRANSACTION statement, but while seemingly signifying the start of the transaction it merely deactivates autocommit.[citation needed]

The result of any work done after this point will remain invisible to other database-users until the system processes a COMMIT statement. A ROLLBACK statement can also occur, which will undo any work performed since the last transaction. Both COMMIT and ROLLBACK will end the transaction, and start anew. If autocommit was disabled using START TRANSACTION, autocommit will often also be reenabled.

Some database systems allow the synonyms BEGIN, BEGIN WORK and BEGIN TRANSACTION, and may have other options available.

[edit] Distributed transactions

Database systems implement distributed transactions as transactions against multiple applications or hosts. A distributed transaction enforces the ACID properties over multiple systems or data stores, and might include systems such as databases, file systems, messaging systems, and other applications. In a distributed transaction a coordinating service ensures that all parts of the transaction are applied to all relevant systems. As with database and other transactions, if any part of the transaction fails, the entire transaction is rolled back across all affected systems.

[edit] Transactional filesystems

The Namesys Reiser4 filesystem for Linux[2] supports transactions, and as of Microsoft Windows Vista, the Microsoft NTFS filesystem[3] supports distributed transactions across networks.

[edit] See also

[edit] References

  1. ^ A transaction is a group of operations that are atomic, consistent, isolated, and durable (ACID).
  • ^ http://namesys.com/v4/v4.html#committing
  • ^ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/portal.asp
  • [edit] Further reading

    [edit] External links


    Retrieved from "http://en.wikipedia.org/w/index.php?title=Database_transaction&oldid=543701502" 

    Categories: 
    Database management systems
    Data management
    Transaction processing
    Hidden categories: 
    Articles needing additional references from August 2010
    All articles needing additional references
    Articles containing potentially dated statements from 2008
    All articles containing potentially dated statements
    All articles with unsourced statements
    Articles with unsourced statements from November 2011
    Articles with unsourced statements from April 2012
     

    Navigation menu

     

    Personal tools



    Create account
    Log in
     



    Namespaces



    Article

    Talk
     


    Variants








    Views



    Read

    Edit

    View history
     


    Actions












    Navigation




    Main page

    Contents

    Featured content

    Current events

    Random article

    Donate to Wikipedia
     



    Interaction




    Help

    About Wikipedia

    Community portal

    Recent changes

    Contact Wikipedia
     



    Toolbox




    What links here

    Related changes

    Upload file

    Special pages

    Permanent link

    Page information

    Cite this page
     



    Print/export




    Create a book

    Download as PDF

    Printable version
     



    Languages




    Česky

    Dansk

    Deutsch

    Ελληνικά

    Español

    Esperanto

    Euskara

    فارسی



    Italiano

    עברית

    Lietuvių

    Nederlands



    Polski

    Português

    Русский

    Simple English

    Српски / srpski

    ி

    Tiếng Vit



    Edit links
     





    This page was last modified on 12 March 2013 at 21:35.

    Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. 
    Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
     


    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Mobile view
     


    Wikimedia Foundation
    Powered by MediaWiki