---------------Transaction---The transaction is completed when it executes to commit, otherwise the rollback operation is performed. Declarev_money acount.money%type:=1223;ex exception;begin update acount set Money=money-v_money where id=1; Raise ex; Update acount set Money=money+v_money where id=2; commit; Exception when others and then dbms_output. Put_Line (' power Down '); Rollback;end;
the task of a transaction is to transform a database from one state to another, unlike a file system, which is a database-specific use. It has four properties:TOMsummarized asACIDthat
Atomic Natureatomicity:statement-level atomicity, process-level atomicity, transactional-level atomicity
ConsistencyConsistency:same State, no two states in the same transaction
Isolation ofIsolation:the separation between transactions is mutually exclusive.(There may also be autonomous matters here)
DurabilityDurability:The transaction commits, then the state is permanent.