zoukankan      html  css  js  c++  java
  • 事务设置函数

    事务设置函数

    • int lr_set_transaction_status(int status)

      设置当前所有处于执行状态的事务的结束状态。如果事务结束函数指定相关事务的结束状态为LR_AUTO,则事务按照新设置的状态结束,否则将按照原来指定的状态结束

    if(event == GENERAL_ERROR)
            lr_set_transaction_status(LR_FAIL);
        lr_end_transaction("登陆",LR_AUTO);
    • int lr_set_transaction_status_by_name(int status,const char * transaction_name)

      用于指定事务的状态。如果事务结束函数指定相关事务的结束状态为LR_AUTO,则事务按照新设置的状态结束,否则将按照原来指定的状态结束

    if(event == GENERAL_ERROR)
            lr_set_transaction_status_by_name(LR_FAIL,"登录");
        lr_end_transaction("登陆",LR_AUTO);
    • int lr_fail_trans_with_error(constchar * format,exp1,exp2,... expn。)

      与lr_set_transaction_instance_status 类似,都可以用于设置事务的状态,区别在于lr_fail_trans_with_error除了可以设置的状态,还可以输出错误日志信息。用法可以参考c语言的printf函数 

      Format:描述用于写入可选剩余表达式exp1,exp2,...expn的格式的字符串。您可以在引号中指定文字字符串,或者使用可用于printf的标准消息格式化。 

      exp1,exp2,.. expn:格式化和打印的可选表达式(变量)。

    if(status != SUCCESS)
            lr_fail_trans_with_error("an error has occurred:%s",my_get_error_string(status));
        lr_end_transaction("登陆成功",LR_AUTO); 
        
    或者
        lr_start_transaction("login");
        lr_fail_trans_with_error("%s","失败");
        lr_end_transaction("login", LR_PASS);//这里指定状态,lr_fail_trans_with_error失去作用
  • 相关阅读:
    深入理解HTTP Session
    java中使用队列:java.util.Queue
    throws/throw Exception 异常应用
    Log4j实现对Java日志的配置全攻略
    java中volatile关键字的含义
    hibernate调用oracle存储过程||函数
    手势仿QQ侧滑---秀清
    归档和解档---秀清
    全局定义UINavigationContoller--By秀清
    重力感应 加速计- By严焕培
  • 原文地址:https://www.cnblogs.com/lvchengda/p/12624947.html
Copyright © 2011-2022 走看看