找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2205|回复: 3

关于4GL中使用事务方法

[复制链接]
  • TA的每日心情
    擦汗
    2017-5-18 09:45
  • 签到天数: 29 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    8

    主题

    50

    回帖

    419

    积分

    中级会员

    积分
    419
    发表于 2017-5-10 10:12:59 | 显示全部楼层 |阅读模式
    各位:你们好!

           我希望在4GL中使用事务,麻烦给个样例,谢谢!

            在手册中有关描述,但没有例子,多次测试也没能搞掂。

    DEFAULT-COMMIT Attribute
    (AppServer only)
    Indicates how an open transaction under the control of a transaction initiating procedure is to
    complete if the procedure is deleted in the absence of any SET-COMMIT( ) method or
    SET-ROLLBACK( ) method.
    Data Type:
    LOGICAL
    Access:
    Readable/Writeable
    Applies To:
    Transaction Object Handle
    Setting the DEFAULT-COMMIT attribute to TRUE ensures that the transaction is completed.
    Setting it to FALSE ensures that the transaction is rolled back. The default value is FALSE.
    NOTE:
    One common event that can terminate an open transaction is deleting the transaction
    initiating procedure that created the transaction.

    SET-COMMIT( ) Method
    (AppServer only)
    Tells the transaction object to commit the transaction when the AppServer session completes
    the current request and returns execution to the client.
    Return Type:
    LOGICAL
    Applies To:
    Transaction Object Handle


    SET-COMMIT ( )
    If the operation is successful, the method returns TRUE. If a transaction initiating procedure is
    not active in the current AppServer session, this method returns FALSE. You also
    cannot
    invoke this method after prior invocation of a SET-ROLLBACK( ) method during service of
    the same client request.

    哎...今天够累的,签到来了1...
  • TA的每日心情
    奋斗
    前天 11:27
  • 签到天数: 1720 天

    连续签到: 3 天

    [LV.Master]伴坛终老

    745

    主题

    1146

    回帖

    3万

    积分

    管理员

    进击的思考者

    积分
    39250
    发表于 2017-5-10 21:42:13 | 显示全部楼层
        edit-loop:
        do on endkey undo , leave
               ON ERROR UNDO,LEAVE:

            create code_mstr  .
                        code_domain = "a" .
                        code_fldname = "a" .
                        code_value = "c" .

                   if hasError then do :
                           undo edit-loop,leave.  /* undo edit-loop,retry edit-loop ----leave 还是 retry 看程序逻辑需求*/
                   end.
                      
        end.
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2024-2-1 09:08
  • 签到天数: 100 天

    连续签到: 2 天

    [LV.6]常住居民II

    21

    主题

    143

    回帖

    1554

    积分

    金牌会员

    积分
    1554
    发表于 2017-7-20 10:29:09 | 显示全部楼层
    nice job 123456
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

  • TA的每日心情
    慵懒
    2021-8-9 18:58
  • 签到天数: 28 天

    连续签到: 1 天

    [LV.4]偶尔看看III

    6

    主题

    67

    回帖

    385

    积分

    中级会员

    积分
    385
    发表于 2019-1-15 19:28:40 | 显示全部楼层
    提示: 该帖被管理员或版主屏蔽
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|百度统计|OpenEdgeStudy快乐学习 ( 沪ICP备15012660号 )

    GMT+8, 2024-4-25 14:28 , Processed in 1.000664 second(s), 22 queries .

    Powered by Discuz! X3.5 Licensed

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表