1 Sap的更新的类型
在sap中,可以使用CALL FUNCTION ... IN UPDATE TASK将多个数据更新绑定到一个database LUW中。程序使用COMMIT WORK提交修改请求。在sap中将更新分四种类型:

相关程序和TCODE
RSM13000-RSM13005
SM13,SM14
相关命令
DB_COMMIT
SET UPDATE TASK LOCAL
CALL FUNCTION '……' IN UPDATE TASK
PERFORM SUBROUT ON COMMIT
COMMIT WORK AND WAIT
COMMIT WORK
 
From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.
 
The database changes that occur within a database LUW are not actually written to the database until after the database commit. Until this happens, you can use a database rollback to reverse the changes. In the SAP System, database commits and rollbacks can be triggered either implicitly or using explicit commands.
隐式事务提交(自动提交事务)Implicit Database Commits
A work process can only execute a single database LUW. The consequence of this is that a work process must always end a database LUW when it finishes its work for a user or an external call. Work processes trigger an implicit database commit in the following situations:
·        When a dialog step is completed
Control changes from the work process back to the SAP GUI.
·        When a function module is called in another work process (RFC).
Control passes to the other work process.
·        When the called function module (RFC) in the other work process ends.
Control returns to the calling work process.
·        When a WAIT statement interrupts the work process.
Control passes to another work process.
·        Error dialogs (information, warning, or error messages) in dialog steps.
Control passes from the work process to the SAP GUI.
显式提交事务Explicit Database Commits
There are two ways to trigger an explicit database commit in your application programs:
·        Call the function module DB_COMMIT
The sole task of this function module is to start a database commit.
·        Use the ABAP statement COMMIT WORK
This statement starts a database commit, but also performs other tasks (refer to the keyword documentation for COMMIT WORK).
隐式事务回滚(自动回滚事务)(Implicit Database Rollbacks)
The following cases lead to an implicit database rollback:
·        Runtime error in an application program
This occurs whenever an application program has to terminate because of an unforeseen situation (for example, trying to divide by zero).
·        Termination message
Termination messages are generated using the ABAP statement MESSAGE with the message type A or X. In certain cases (updates), they are also generated with message types I, W, and E. These messages end the current application program.
显式回滚事务(Explicit Database Rollbacks)
You can trigger a database rollback explicitly using the ABAP statement ROLLBACK WORK. This statement starts a database rollback, but also performs other tasks (refer to the keyword documentation for ROLLBACK WORK).
From the above, we can draw up the following list of points at which database LUWs begin and end.
开始数据库事务A Database LUW Begins
·        Each time a dialog step starts (when the dialog step is sent to the work process).
·        Whenever the previous database LUW ends in a database commit.
·        Whenever the previous database LUW ends in a database rollback.
结束数据库事务A Database LUW Ends
·        Each time a database commit occurs. This writes all of the changes to the database.
·        Each time a database rollback occurs. This reverses all of the changes made during the LUW.
Database LUWs and Database Locks
As well as the database changes made within it, a database LUW also consists of database locks. The database system uses locks to ensure that two or more users cannot change the same data simultaneously, since this could lead to inconsistent data being written to the database. A database lock can only be active for the duration of a database LUW. They are automatically released when the database LUW ends. In order to program SAP LUWs, we need a lock mechanism within the R/3 System that allows us to create locks with a longer lifetime (refer to The SAP Locking Concept).

关于SAP的事务提交和回滚(LUW)的更多相关文章

  1. 【转】批量复制操作(SqlBulkCopy)的出错处理:事务提交、回滚

    原文地址:http://blog.csdn.net/westsource/article/details/6658109 默认情况下,批量复制操作作为独立的操作执行. 批量复制操作以非事务性方式发生, ...

  2. JDBC03 利用JDBC实现事务提交与回滚【调用Connection中的方法实现事务管理】

    目录 1 Connection中的重用方法 2 JDBC事务管理经典案例 1 Connection类中常用的方法回顾 1.1 Statement createStatement() throws SQ ...

  3. RocketMQ源码分析之RocketMQ事务消息实现原下篇(事务提交或回滚)

    摘要: 事务消息提交或回滚的实现原理就是根据commitlogOffset找到消息,如果是提交动作,就恢复原消息的主题与队列,再次存入commitlog文件进而转到消息消费队列,供消费者消费,然后将原 ...

  4. 关于jave在oracle驱动下事务提交与回滚问题

    一直以来,都觉得Connection假设设置了setAutoCommit(false)后.启动手工事务提交.必须手工进行commit或者rollback才行.今天正好遇到一个问题.结果大跌眼镜. 于是 ...

  5. 对mysql事务提交、回滚的错误理解

    一.起因 begin或者START TRANSACTION开始一个事务 rollback事务回滚 commit 事务确认 人们对事务的解释如下:事务由作为一个单独单元的一个或多个SQL语句组成,如果其 ...

  6. MySQL事务提交与回滚

    提交 为了演示效果,需要打开两个终端窗口,使用同一个数据库,操作同一张表 step1:连接 终端1:查询商品分类信息 select * from goods_cates; step2:增加数据 终端2 ...

  7. mysql事务提交和回滚机制

    应用场景:   银行取钱,从ATM机取钱,分为以下几个步骤       1 登陆ATM机,输入密码:    2 连接数据库,验证密码:    3 验证成功,获得用户信息,比如存款余额等:    4 用 ...

  8. J2EE分布式事务中的提交、回滚方法调用异常。

    这个是昨天上班的时候,写一个后台程序的调试程序时碰到的问题,和项目经理纠结了一天,最后搞定了.于是今天上班正好闲着,花了几乎一天的时间去网上找各种相关的资料.目前了解的内容如此: 根据使用的weblo ...

  9. nestd事务如果报错了 则回滚到外部事物保存点 且外部事物如果没异常的话 会正常提交 nested事务并不会提交;如果外部事物报错了 内部事务会一同回滚

    nestd事务如果报错了 则回滚到外部事物保存点 且外部事物如果没异常的话 会正常提交 nested事务并不会提交:如果外部事物报错了 内部事务会一同回滚

随机推荐

  1. Yii2的深入学习--继承关系

    想要了解 Yii2 的话,一定要对 Yii2 中相关类的继承关系有所了解.由于暂时读的代码有限,下面的图中只列出了部分继承关系,之后回跟着源码阅读的越来越多而增加 由上图可以看到 Yii2 中大多数类 ...

  2. 数据可视化(8)--D3数据的更新及动画

    最近项目组加班比较严重,D3的博客就一拖再拖,今天终于不用加班了,赶紧抽点时间写完~~ 今天就将D3数据的更新及动画写一写~~ 接着之前的博客写~~ 之前写了一个散点图的例子,下面可以自己写一个柱状图 ...

  3. Linux文件标示

    平时在使用ls -l时可以看到 [root@myserv /]# ls -l total 28 drwxr-xr-x 3 root root 21 Sep 17 11:29 app lrwxrwxrw ...

  4. Javascript内存泄露

    在过去一些的时候,Web开发人员并没有太多的去关注内存泄露问题.那时的页面间联系大都比较简单,并主要使用不同的连接地址在同一个站点中导航,这样的设计方式是非常有利于浏览器释放资源的.即使Web页面运行 ...

  5. libqxt编译

    一.说明 编译环境:win10.qt5.6.1-1.vs2013和libqxt源码(从git上下载) libqxt:libqxt 关于libqxt的说明,请到libqxt的官网阅读,说着看图1,图1是 ...

  6. UEditor 1.4.3.1.NET版本上传配置备忘录

    UEditor用起来还是挺方便的,下面是记录一下在上传中的配置问题(主要是上传图片的配置,其他的都是类似的). 我下载的是UEditor 1.4.3.1 .NET版本. 官网的配置说明地址为 http ...

  7. JavaScript动态增删改表格数据

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  8. easyui-layout 布局自适应

    最近在把以前写的一个项目改成用easyui做前端.过程中遇到了不少问.其中一个就是datagrid不能很好的布.想了好多办法都有局限.最后想到会不会是布局的问题,经过实,最后问题解. 1:比如在项目中 ...

  9. 介绍开源的.net通信框架NetworkComms框架 源码分析(五)ReservedPacketType

    原文网址: http://www.cnblogs.com/csdev Networkcomms 是一款C# 语言编写的TCP/UDP通信框架  作者是英国人  以前是收费的 目前作者已经开源  许可是 ...

  10. iBoxDB的学习与使用

    1. 引言 一次偶然的机会接触到了iBoxDB这样一个小型的嵌入式对象数据库.感觉非常惊讶有这样轻巧的数据库.iBoxDB 本身是一个NOSQL 同时也有关系数据库的特点. 说说iBoxDB的优点: ...