Skip to Content
author's profile photo Former Member
Former Member

How test if a call of a transaction fails inside another transaction

Hi there,

I have two transactions: T1 and T2. T1 calls T2. T2 have a "SQL" action.

When I disable the data server used for that SQL action my sql command fails. Thats okay. So a have a "Conditional" action testing the parameter "sucess" of that SQL action and when it is "false" a "Terminate transatcion" action is used. The links are:

Terminate_Transaction.TerminateWithError = sql_nameOfQuery.Success

Terminate_Transaction.TerminationMessage = sql_nameOfQuery.Results{/Rowsets/FatalError}

Using a "Trace" action in T2 I can see that:

sql_nameOfQuery.Success = false

sql_nameOfQuery.Results{/Rowsets/FatalError} = "Server Test is currently disabled"

My problem is how T1 kowns that T2 was terminated with a fail. I put a "conditional" action with the link:

Conditional.Output = not( T2.Success )

and it is not working for me. Is this link right for the Conditional action?

Despite de fact it call a "Terminate transaction" action I have always "OK" value for T2.Sucess!

Using a "Trace" action in T1 I can see that:

T2.Sucess = OK

T2LastErrorMessage = TRANSACTION EXECUTED OK

Thank in advance,

Nuno Cunha

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 10, 2009 at 12:13 PM

    Nuno,

    in your T2, you can populate the TerminationMessage with your Error Text from the query.

    In T1, you will receive the error message in T2.LastErrorMessage. If you set the TerminateWithError Flag in T2, you can evaluate the T2.Success flag in T1 which will then be false. If you do not set the TerminateWithError in T2, the T2.Success Flag will be true, however the LastErrorMessage will still be set.

    The text "TRANSACTION EXECUTED OK" in T2.LastErrorMessage will appear if the Transaction (T2) was not terminated.

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.