Author |
Message
|
AlanG |
Posted: Fri Oct 26, 2012 6:41 am Post subject: How to specify a timeout when calling a Stored Procedure? |
|
|
Newbie
Joined: 26 Oct 2012 Posts: 3
|
I have a Compute Node which calls a DB2 z/OS stored procedure via an ODBC data source.
I would like to specify a timeout on the stored procedure call. i.e. If the stored procedure invocation takes longer then x seconds I would like control to return to the flow.
However, so far I have been unable to determine how I can set this.
Does anyone know how I would go about configuring such a timeout?
Is there a default timeout if nothing is explicitly set? My concern is that the flow will wait forever for the stored procedure call to return.
Thanks |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Oct 26, 2012 6:43 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Put the DB call in its own flow driven by either SOAPInput or MQInput. Have your original flow make a call to the new flow. You can timeout on MQGet or SOAPRequest. If using MQ, be sure to set transactionality to NO. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
AlanG |
Posted: Tue Nov 06, 2012 2:25 am Post subject: |
|
|
Newbie
Joined: 26 Oct 2012 Posts: 3
|
Thanks for your reply lancelotlinc. From what I had read it didn't look like it was possible to set a timeout when using ODBC.
I have been reading up on JavaCompute nodes. I think if I use a Type 4 JDBC Connection from a JavaCompute node I should be able to specify a timeout on the connection.
Thanks for your help. |
|
Back to top |
|
 |
broker_new |
Posted: Tue Nov 06, 2012 7:22 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
You have not mentioned the version...WMBv8.0 has that property available to use _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
AlanG |
Posted: Wed Nov 07, 2012 6:44 am Post subject: |
|
|
Newbie
Joined: 26 Oct 2012 Posts: 3
|
I should have specified on my original post that I am running WMB 7.0. |
|
Back to top |
|
 |
broker_new |
Posted: Wed Nov 07, 2012 8:33 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
i think it is available in 7.0 as well, check out the LoginTimeout=0 property in the odbc.ini file. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
mayheminMQ |
Posted: Thu Nov 08, 2012 4:06 am Post subject: |
|
|
 Voyager
Joined: 04 Sep 2012 Posts: 77 Location: UK beyond the meadows of RocknRoll
|
Hi Alan,
Lancellot's suggestion is one of the easier ways of doing it.
If that is not viable, I have a not so good looking option.
Inputnode(MQ or File or watever) --> Compute Node
--> Propagate a timer message for say 5 mins to TimeoutControl node.
--> Call the stored proc
-->If control comes back to Esql node after stored proc is done, propagate a Timer Cancel msg TimeoutControlNode.
--> Else wait for a timeout message to comeout of timeout notification node and throw out an error or something to stop any further transaction from taking place. This error could be further caught and then your normal transaction could go on.
This should work in theory unless I have forgotten something.
And yup told ya it wouldnt be pretty.
In short go with lancelot's approach.. cleaner.. maintainable and makes sense  |
|
Back to top |
|
 |
|