Register Login

Difference between Commit Work and Rollback Work Tasks

Updated May 18, 2018

Commit-Work vs. Rollback-Work Tasks

Commit-Work statement "performs" many functions relevant to synchronized execution of tasks. Rollback-Work statement "cancels" all requests relevant to synchronized execution of tasks.


Comments

  • 22 Sep 2013 6:42 pm Guest Best Answer

    COMMIT WORK. Executes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). 

    This means that 

    • All database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and 
    • All database locks are released. COMMIT WORK also 
    • Calls the subroutines specified by PERFORM ... ON COMMIT * executes asynchronously any update requests (see CALL FUNCTION ... IN UPDATE TASK ) specified in these subroutines or started just before, 
    • Processes the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK , 
    • Cancels all existing locks (see SAP locking concept ) if no update requests exist, 
    • Closes all open database cursors (see OPEN CURSOR ) and 
    • Resets the time slice counter to 0. COMMIT WORK belongs to the Open SQL command set. Return code value The SY-SUBRC is set to 0. 

    ROLLBACK WORK. Closes a logical processing unit by reversing all database changes made since the last COMMIT . You use this statement if you cannot be certain that all the database changes have been executed correctly. The update routines are not performed. 

    ROLLBACK WORK belongs to the Open SQL command set. Note If the ROLLBACK statement occurs within a SELECT loop, the processing cannot continue because the database cursor is invalid. After the ROLLBACK statement, you should therefore ensure that all SELECT processing has been explicitly terminated.

    Please Avoid Duplicate Threads.


×