variable resetting its value after error

I am setting a variable with a setup value ‘xxx’ before a Main/Try/Catch Sequence

The variable value is modified from a SQL Output using a Loop, it works without a problem.

The problem is when in the Try Sequence got an error, when jumping to the Catch Sequence, the value of the variable resets back to ‘xxx’ (the original setup value).

I am perplexed with this behavior, what I need is that the variable keeps its last value in order to setup the error treatment with the value set when the error occurred.

Thanks

This behavior is expected.

When a SEQUENCE step exits on failure, the Integration Server rolls back the pipeline contents. That is, the Integration Server returns the pipeline to the state it was in before the SEQUENCE step executed.

Can you please explain what you are trying to achieve?

1 Like

Can you try to get the value from catch block like
Use Service getLastError
then map value from lastError/Pipeline/VariableName

Thanks

2 Likes

Hi Luis,

The IS is working as it is suppose to and it is to sustain consistent data. Kindly let us know what’s still exist on top of your head.

Thanks,

Thanks for clarifying this is an IS expected behavior.

Once M@he$h wrote that is an IS expected behavior, I then knew the value has to be somewhere else, Baharul save me looking for it just pointing where the value is.

I don’t remember if this issue was discussed in training or not, but if it is not, it is a big issue. I’ll check my material.

Anyway, Thank you very much for your help.

Following this lines I’ll explain what my service do, it is running great!!!

Regards.


The service collects data sequentially from 9 remote locations; if one fails, I want to set a mark in a control table, so, in the retry the “error” remote location will be tried as the very last of the locations.

Lets say the connection #3 is faulty. Under a strict sequential order with standard error catch/retry sequence, the service will always break at conn #3 and will not continue to #4 to #9.

At the beginning of my service I query a control table for “ready” and “error” status, following the example:

Query the control table, I got connection #1 to #9 (On the first run the all connections always are “ready”).
Try
Loop over connections(#1#9)
#1 is read, mark “ok”
#2 is read, mark “ok”
#3 is error, mark “error”
Go to catch sequence
retry the service…

At the retry
I query the control table for the “ready” and “error” status (leaving the “error” status for last), so got now connection #4 to #9, #3 (#1 and #2 are don already)
loop over connections (#4#9)
#4 is read, mark “ok”
#5 is read, mark “ok”

#9 is read, mark “ok”
#3 is error, mark “error”

So, in the end. even if I have one bad connection, I got 8 successful readings. I then reschedule the service for a fresh try later.

On rescheduled run of the service:
The query will return just connection #3, because all others have been read and have a “ok” status.
When #3 is finally read, then all control table is “ok”, service will reset connection from “ok” to “ready”, refreshing the table for next scheduled run.

That’s why I needed one variable that change its value for every loop. I need the value when got the error. Basically to mark on my control table with error.