Ending Your Logical Unit of Work
The term logical unit of work means a sequence of SQL commands that DB2 Server for VM views as a unit of consistency and recovery. (These commands can be mixed with non-SQL statements.) This concept is useful because DB2 Server for VM can ensure the integrity of the database. It does this by making sure that either all or none of the updates in a logical unit of work are done.
A logical unit of work begins with any SQL command and ends with a COMMIT WORK or ROLLBACK WORK command. If a system failure occurs before the explicit end of a logical unit of work, SQL automatically restores all changes made from the start of the logical unit up to the point of system failure. This is called a rollback. However, you must tell DB2 Server for VM what to do for SQL errors.