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. jQuery.noConflict()

    转载:http://blog.163.com/mjuxiaom@126/blog/static/13397047120117324320858/ 运行这个函数将变量$的控制权让渡给第一个实现它的那个库 ...

  2. [转载]UML用例图总结

    前言 用例图主要用来描述“用户.需求.系统功能单元”之间的关系.它展示一个外部用户能够观察到的系统功能模型图.用例图多用于静态建模阶段(主要是业务建模和需求建模),帮助开发团队以一种可视化的方式理解系 ...

  3. 列表视图(ListView和ListActivity)

    在ListView中显示网络图片 ImageView 类虽然有一个 setImageUri 方法,但不能直接接受一个由网络地址生成的uri作为参数从而显示图片,我们只好使用其 setImageBitm ...

  4. LINUX总结

    LINUX总结 crazyacking 2016-02-26 主要对socket编程,多线程,定时器,条件变量总结 多线程篇 概念: 多线程就是允许一个进程内存存在多个控制权,实现多个线程并发执行. ...

  5. 【原创】Kakfa utils源代码分析(二)

    我们继续研究kafka.utils包 八.KafkaScheduler.scala 首先该文件定义了一个trait:Scheduler——它就是运行任务的一个调度器.任务调度的方式支持重复执行的后台任 ...

  6. 【转】Validate + Boostrap tooltip 表单验证示例

    一.工具准备: 1.boostrap: 下载地址 http://getbootstrap.com/ jquery: jQuery版本需大于或等于1.8.0  jquery.validate.min.j ...

  7. .Net语言 APP开发平台——Smobiler学习日志:用MenuView控件仿钉钉APP的首页菜单

    最前面的话:Smobiler是一个在VS环境中使用.Net语言来开发APP的开发平台,也许比Xamarin更方便 一.目标样式 我们要实现上图中的效果,需要如下的操作: 1.从工具栏上的”Smobil ...

  8. ADB am 命令详细参数

    usage: am [subcommand] [options] usage: am start [-D] [-W] [-P <FILE>] [--start-profiler <F ...

  9. 如何在Web项目中给没有添加API核心组件添加APIController的帮助页HelpPage

    前言: ASP.NET中的Web项目可以通过APIController控制器来为其他项目提供接口.  而我们在调试这些接口时,可以选择单元测试,网页测试(Get接口),自己写测试代码或者第三方测试工具 ...

  10. iOS阶段学习第15天笔记(NSArray与NSMutableArray 数组)

    iOS学习(OC语言)知识点整理 一.OC中的数组 1)数组:也是一个对象,数组中存放的是对象的地址,可以存放任意类型对象的地址,只能是对象不能是具体的数值,数组是有序的,      可以存放重复的元 ...