Skip to Content
author's profile photo Former Member
Former Member

What is Database Commit and Database Rollback.

What is Database Commit and Database Rollback.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 06:58 AM

    Hi Sir ,

    Please have a look below .Hope it is suitable and simpler solution for your question.

    Please do reward if useful.

    Thankx.

    In database level this will be used..

    Commit is nothing but SAVE the current record..

    If u rol back before commit means whatever u proceeded for the SAVING will be roll back and the data will not be stored..

    This will be used,When some times u r filling a register form..after filling 20 fields,In the 21st field u will not to registrer means it will be rollbacked using the Rollbeck command.

    In detail--->

    ROLLBACK->

    In a ROLLBACK, all the changes made by a transaction or a subtransaction on the database instance are reversed.

    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

    · As a result of a ROLLBACK, a new transaction is implicitly opened.

    In normal database operation, the database system performs the required ROLLBACK actions independently. However, ROLLBACK can also be explicitly requested using appropriate SQL statements.

    In a restart, the system checks which transactions were canceled or closed with a ROLLBACK. The actions are these transactions are undone.

    COMMIT->

    In a COMMIT, all the changes made by a transaction or a subtransaction on the database instance are recorded.

    · Changes closed with a COMMIT can no longer be reversed with a ROLLBACK.

    · As a result of a COMMIT, a new transaction is implicitly opened.

    In normal database operation, the database system performs the required COMMIT actions independently. However, COMMIT can also be explicitly requested using appropriate SQL statements.

    In a restart, the system checks which transactions were closed with a COMMIT. These actions are redone. Transactions not yet closed with a COMMIT are undone.

    ************************************

    From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.

    the statements

    COMMIT WORK.

    and

    ROLLBACK WORK.

    for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2008 at 07:02 AM

    COMMIT : Commit is nothing but to SAVE the current record..

    ROLLBACK : If you use the ROLLBACK before commit it means whatever you have proceeded before SAVING will be rollbacked and the data will not be stored..

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.