cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-thread transaction call

Former Member
0 Kudos

Hello,

I would have a master transaction which calls a slave transaction as "separated thred". Master transaction has not to stop.

I tried to call it with HTTP_Post, HTML_Loader and Transaction blocks but everytime I obtained the same result: master transaction stops, waits the end of slave transaction and then continues.

Does anyone how to do this?

Thank you a lot!!

Fabio

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Hi Fabio,

There is an Asynchronous Transaction Call action block in 12.1 and higher which does exactly what you request. 

If you are in an older version, there are some games you can play using scheduler, but before laying those out, what version/build of MII (and NW if applicable) are you using?

Regards, Mike

Former Member
0 Kudos

12.0.11

I need to update it: every time the solution of my problems is: "since version 12.1 there is a way to do this..."

Thank you

Which can be the trick with the scheduler of the version 12.0?

agentry_src
Active Contributor
0 Kudos

This is something I did back in 11.5 time.  In other words a long time ago, but it might work for you. 

You have a master transaction MSTR1 and two subordinate/slave transactions STRX1 and STRX2.  You wish to have MSTR1 execute and then have STRX1 and STRX2 execute as a result of MSTR1 starting.  I don't know whether this needs to be real time or what lag time is acceptable.  What I did was have two scheduled jobs calling STRX1 and STRX2 every 5 minutes.  Within the beginning of each of the two jobs was a job to see if a small xml file was present (which also contained some property values).  If it was STRX1 would gather the file and process the data it contained.  Similarly for STRX2.  Now both scheduled jobs would execute on separate threads and independent of MSTR1.  MSTR1 could execute dynamically from a webpage (what I did), from the workbench, or from a scheduled job.  It's role was to do its processing and then create the small xml file with the required data.  The presence of the file(or files) would switch (Condition action block) the execution of STRX1 and STRX2 from a terminate transaction action block to an active processing path.  Depending on your data requirements, two xml files might be better so that at the end of processing STRX1 and STRX2 would delete the small xml files.

It worked for me way back when since I had a roughly 1 hour time window for finishing execution of all three files.

Regards, Mike

Former Member
0 Kudos

Yes, the solution seems a way to solve the problem, but I will need to keep the web page opened.

The upgrade solution (to version 12.1 or newer) seems the best way in my opinion.

Than you a lot!!

Best regards, Fabio

Answers (1)

Answers (1)

Former Member
0 Kudos

You could set a low timeout on the HTTP_Post action and then the transaction will continue without waiting for the response.

Former Member
0 Kudos

Using this trick I obtain the wished result but the trace logger contains many errors:

  • [ERROR]: Post error: org.apache.commons.httpclient.HttpRecoverableException: java.net.SocketTimeoutException: Read timed out
  • [ERROR]: ACTION FAILED: End Action HTTP_Post : ( )

But...it is a possible way. Thank you!!

Former Member
0 Kudos

You could also post to the message listener interface to trigger transactions asynchronously. One advantage is that you would also have a record of the event and possibly a way to deal with any failures or errors.