Local Copy of Employees Table
CREATE TABLE employees AS SELECT * FROM hr.employees
Table created.
A Mean Autonomous Transaction Procedure
CREATE OR REPLACE PROCEDURE fire_em_all
IS
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
DELETE FROM employees;
COMMIT;
END;
Procedure created.
Impact of Serialization of Transaction
DECLARE
num INTEGER;
BEGIN
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SELECT COUNT (*)
INTO num
FROM employees;
DBMS_OUTPUT.put_line ('Before isolated AT delete ' || num);
fire_em_all;
SELECT COUNT (*)
INTO num
FROM employees;
DBMS_OUTPUT.put_line ('After isolated AT delete ' || num);
COMMIT; -- ROLLBACK;
SELECT COUNT (*)
INTO num
FROM employees;
DBMS_OUTPUT.put_line ('After MT commit ' || num);
END;
Before isolated AT delete 107
After isolated AT delete 107
After MT commit 0