1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Progress-4gl: How does transaction scope apply to external program calling?

Discussão em 'StackOverflow' iniciado por fdantas, Setembro 2, 2020.

  1. fdantas

    fdantas Administrator Moderador

    I need some help understanding transaction scoping for procedures/programs outside the current program.

    Suppose I've three program, program A, program B and program C. Inside program A, I've a procedure that has some lines in it wrapped inside a do transaction (not strongly typed) block. Within that do transaction block, it calls another Program B. Upon return from program B there is an undo, leave command. Within the same transaction block, it calls program C and has an undo, leave after this call too.

    My question is, if within the transaction block, program B executes without errors, but program c returned an error, will the undo,leave after program C call will also undo transactions that happened inside program B?

    Procedure do_something:
    some processing....
    do transaction:
    error-message = "".
    {run programB.p}
    if error-message <> "" then undo, leave.

    some further processing...

    error-message = "".
    {run programC.p}
    if error-message <> "" then undo, leave.
    end. /* end of do transaction */
    end procedure.

    Continue reading...

Compartilhe esta Página