SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is transaction ?

    Why we use it ?

    A simple example is appreciated.

  2. #2
    SitePoint Enthusiast Dharma's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <samsara>You are here.</samsara>

  3. #3
    SitePoint Guru
    Join Date
    Sep 2008
    Location
    Dubai
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dharma View Post
    I can't understand that

  4. #4
    SitePoint Enthusiast Dharma's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then learn. You requested information about database transactions, I supplied it to you. You can't expect all information to be pre-chewed. Maybe start with the wikipedia article on databases instead? Progress gradually.

    Edit: It even gives an example!

    Quote Originally Posted by The Wikipedia hive mind
    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 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.
    <samsara>You are here.</samsara>

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,597
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    At its simplest:

    A transaction is a collection of database updates where either all must be applied or none. If there are any issues with applying any of the updates then all of the changes applied as part of the transaction need to be undone.

    A transaction ends with a COMMIT to apply all the changes or a ROLLBACK to undo them all.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •