自治事务和非自治事务的区别


下面是个简单的测试,可以让大家更加清楚的明白自治事务和非自治事务的区别:          SQL> create table chris_test (name varchar2(200));
        Table created.
        SQL> create or replace procedure Autonomous_insert
         as
         pragma autonomous_transaction;
         begin
         insert into chris_test values ('Autonomous Insert!');
         commit;
         end;
        Procedure created.
        SQL> create or replace procedure Nonnomous_insert
         as
         begin
         insert into chris_test values ('Nonnomous Insert!');
         commit;
         end;
        Procedure created.
        SQL> begin
         insert into chris_test values ('Anonymous Block!');
         Nonnomous_insert;
         rollback;
         end;
        PL/SQL procedure successfully completed.
        SQL> select * from chris_test;
        NAME
        ------------------------------------------------          Anonymous Block!
        Nonnomous Insert!
        SQL> truncate table chris_test;
        Table truncated.
        SQL> begin
         insert into chris_test values ('Anonymous Block!');
         Autonomous_insert;
         rollback;
         end;
        PL/SQL procedure successfully completed.
        SQL> select * from chris_test;
        NAME
       ----------------------------------------------

        Autonomous Insert!

 

本文作者:



相关阅读:
影响SQLserver性能的关键三个方面
asp.net中一个linq分页实现代码
CSS网页布局问题:li上多出的margin问题
巧用FileSystem组件实现WEB应用中的本地特定打印的方法
Ubuntu Linux系统环境变量配置文件介绍
WordPress主题不显示中文标题的解决方法
JavaScript中的一些定位属性[图解]
非常漂亮的css星级效果总结
关於 FreeBSD
JS网络游戏-(模拟城市webgame)提供的一些例子下载
6 个漂亮的Ubuntu 8.10主题设计
MySQL编译调整优化简明指南
时尚的CSS3进度条效果
TeraCopy v2.01 Final 快速复制功能
快速导航

Copyright © 2016 phpStudy |