1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Stackoverflow]

Discussão em 'StackOverflow' iniciado por fdantas, Setembro 9, 2024.

  1. fdantas

    fdantas Administrator Moderador

    I'm trying to apply changes and release the changed tables in a sub transaction but not yet in the main transaction.

    Like so:

    MAIN_TRANSACT:
    DO TRANSACTION:

    // do stuff

    SUB_TRANSACT:
    DO TRANSACTION:
    // change stuff
    FIND testTable WHERE ... SHARE-LOCK.
    IF AVAILABLE testTable THEN DO:
    testTable.value = "new value".
    RELEASE testTable.
    END.
    END. // apply

    // do stuff

    END.


    But all what progress does, is not apply the data after the end of the sub transaction.

    What i tried:


    I tried to do it like Tom said here and use a different file with a different session.

    // main.p

    DEFINE VARIABLE hSubFile AS HANDLE NO-UNDO.
    IF NOT VALID-HANDLE(hSubFile) THEN DO:
    RUN sub.p PERSISTENT SET hSubFile.
    END.

    MAIN_TRANSACT:
    DO TRANSACTION:

    // do stuff

    RUN subTransaction IN hSubFile.

    // do stuff

    END.

    DELETE OBJECT hSubFile NO-ERROR.


    // sub.p

    PROCEDURE subTransaction:

    SUB_TRANSACT:
    DO TRANSACTION:
    // change stuff
    FIND testTable WHERE ... SHARE-LOCK.
    IF AVAILABLE testTable THEN DO:
    testTable.value = "new value".
    RELEASE testTable.
    END.
    END. // apply

    END PROCEDURE.


    But this didn't work, but I also think I did it wrong. Since this did not really spawn a new "_progress.exe" process.

    I hope someone can help me.

    Continue reading...

Compartilhe esta Página