cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction identity

Former Member
0 Kudos

Hello,

I have a transaction with unknow execution time. It's execution time can be between 1 second and some minutes.

I want to start it with a scheduled job of about 5s.

I must be sure that it is executed just one instance at a time.

My actual idea is to create a main transaction with the logic of mutex (decrease variable, check its value, start slave transaction if value ok, increase variable).

In slave transaction i will put my code.

My doubt is: if main transaction stops for netwaver error or my code error, how can I see the problem and restore mutex value? Is it impossible that a transaction stops in strange mode?

Is there other way to implement a mutex in MII?

Is there other way to do what I need?

I use MII12.0.

Thank you

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

former_member202228
Active Participant
0 Kudos

The logic is correct. I'm using the same idea in dealing with connectors to PLCs and Historians (with no connetion pool).

One main transaction monitors the "usage" and flags it using a boolean variable.

The child transaction runs and may end sooner or later. Treat the errors accordingly and push the "success" or "failure" out of it to the main transaction via output parameters. No matter what the outcome, the main transaction will be able to restore the flag to the default value after the child transaction is completed (successfully or not).

Main transaction is simple enough (just updates a flag), so it should not stop prematurely. If it does (depending where you store the flag value, you might have/loose access and/or connectivity, or not) you should allow for a max execution time on the storage system. The stored value may be reset at the subsequent flag change if the execution time is exceeded - check also the max timeouts and allow for sufficient time for the child to finish in all cases.

You might create or capture a transaction ID for the child process and store it together with the flag. Thus , you might check for it's existance while resseting the stored values automatically.

paul.

Former Member
0 Kudos

mmm...the idea of check execution time is very good.

Thank you a lot

Fabio

Answers (0)