Hi, *
I wonder if you guys have a standard way of dealing with the
following problem which is not very likely to happen but
gives you problems in batch jobs running on a regular basis:
With Informix (tested on Versions up to 9.2 - I suppose its
the same with newer versions because it is due to the
client db data exchange protocol - please correct me if I am
wrong) the following can happen:
1. client connencts
2. client sends select to server which will take lets say
a second to get the result
3. client starts waiting for server to answer
4. server dies / connection breaks
Result: client waits forever.
One way to deal with this is to kill the statement if there
is no result after some defined amout of time.
Is there a better way?
Thanks,
Dirk

Signature
--
-- Dirk Gunsthoevel IT Systemanalyse phone: +49 (0)251 28446-0
-- Hammer Str. 13 fax: +49 (0)251 28446-55
-- D-48153 Muenster http://www.GunCon.de/
-- "It ain't over 'til it's over."
Sheshnarayan Agrawal - 22 Jun 2008 05:53 GMT
What's the client API you are using and its version? If you are using ODBC
you can try SQL_ATTR_QUERY_TIMEOUT attribute to set the timeout for your
query/statement. However I am not aware of any such issue, in case of
server dies client waits forever to finish the query execution (in this
case returning error) !! Is it possible to share your testcase and
possible reproduction scenario in little more details (i.e. platforms
used, connectivity protocl used etc)?
-Shesh
"Dirk Gunsthövel" <dirk@guncon.de>
Sent by: informix-list-bounces@iiug.org
22/06/2008 05:33
To
informix-list@iiug.org
cc
Subject
Connection break during waiting for resultset - how to deal with?
Hi, *
I wonder if you guys have a standard way of dealing with the
following problem which is not very likely to happen but
gives you problems in batch jobs running on a regular basis:
With Informix (tested on Versions up to 9.2 - I suppose its
the same with newer versions because it is due to the
client db data exchange protocol - please correct me if I am
wrong) the following can happen:
1. client connencts
2. client sends select to server which will take lets say
a second to get the result
3. client starts waiting for server to answer
4. server dies / connection breaks
Result: client waits forever.
One way to deal with this is to kill the statement if there
is no result after some defined amout of time.
Is there a better way?
Thanks,
Dirk

Signature
--
-- Dirk Gunsthoevel IT Systemanalyse phone: +49 (0)251 28446-0
-- Hammer Str. 13 fax: +49 (0)251 28446-55
-- D-48153 Muenster http://www.GunCon.de/
-- "It ain't over 'til it's over."
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
Dirk Gunsthövel - 22 Jun 2008 13:14 GMT
Hi,
thanks for your reply.
I see this happening with EC as well as odbc clients but my main issue
is jdbc (informix jdbc version does not matter; db versions I testet are
up to 9.x on Windows and up to 7.31 on SCO Unix - old versions
I know... client versions).
Setting up this case is easy: lets say you have a router with your client
and server connected to it.
You use a simple jdbc program connecting and issuing a query which
runs just long enough to act (lets say some seconds).
After the query is sent to the server you physically disconnect the
server (i.e. unplugging the servers cable from the router).
The client will wait forever then.
You can get the same result on one machine when you use a
informix server in a vmware virtual machine on your client with
the vmware player and hard-close this machine after the query
is started.
As I said it took me a while to find this problem because in reality
it doesnt happen very often. It all started with some batch processes
of mine stopping to work once in a while (once a month or so).
btw: does ODBC SQL_ATTR_QUERY_TIMEOUT really work with
Informix? As for JDBC, it is not implemented for the versions I
have to use so my solution right now is to have a watcher thread running
which kills the statement after a while.
I think we both agree that both these "solutions" are not perfect anyways
because I dont want to limit the execution time but detect the
error. As a workaround its ok but not nice.
Regards,
Dirk
What's the client API you are using and its version? If you are using ODBC you can try SQL_ATTR_QUERY_TIMEOUT attribute to set the timeout for your query/statement. However I am not aware of any such issue, in case of server dies client waits forever to finish the query execution (in this case returning error) !! Is it possible to share your testcase and possible reproduction scenario in little more details (i.e. platforms used, connectivity protocl used etc)?
-Shesh
"Dirk Gunsthövel" <dirk@guncon.de>
Sent by: informix-list-bounces@iiug.org
22/06/2008 05:33
To informix-list@iiug.org
cc
Subject Connection break during waiting for resultset - how to deal with?
Hi, *
I wonder if you guys have a standard way of dealing with the
following problem which is not very likely to happen but
gives you problems in batch jobs running on a regular basis:
With Informix (tested on Versions up to 9.2 - I suppose its
the same with newer versions because it is due to the
client db data exchange protocol - please correct me if I am
wrong) the following can happen:
1. client connencts
2. client sends select to server which will take lets say
a second to get the result
3. client starts waiting for server to answer
4. server dies / connection breaks
Result: client waits forever.
One way to deal with this is to kill the statement if there
is no result after some defined amout of time.
Is there a better way?
Thanks,
Dirk
--
--
-- Dirk Gunsthoevel IT Systemanalyse phone: +49 (0)251 28446-0
-- Hammer Str. 13 fax: +49 (0)251 28446-55
-- D-48153 Muenster http://www.GunCon.de/
-- "It ain't over 'til it's over."
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
Fernando Nunes - 22 Jun 2008 12:08 GMT
> Hi, *
>
[quoted text clipped - 22 lines]
> Thanks,
> Dirk
Do you have a firewall in the middle?
Regards.
Dirk Gunsthövel - 24 Jun 2008 11:24 GMT
Hello,
after most of the ng and mail answers indicated that
nobody seems to have this problem I prepared
a little screen demo.
You can find this at
http://www.guncon.de/ifx_dead_con/
Any comments?
Regards,
Dirk

Signature
-- Dirk Gunsthoevel IT Systemanalyse phone: +49 (0)251 28446-0
-- Hammer Str. 13 fax: +49 (0)251 28446-55
-- D-48153 Muenster http://www.GunCon.de/
-- "It ain't over 'til it's over."
david@smooth1.co.uk - 25 Jun 2008 07:23 GMT
> Hello,
>
[quoted text clipped - 16 lines]
> -- D-48153 Muenster http://www.GunCon.de/
> -- "It ain't over 'til it's over."
If this i using a TCP connection then you will need to wait for tcp to
timeout the connection via the "keepalive" mechanism
that is normally around 10 minutes. Read up to TCP keepalive and the
good reasons why the timeout is so high.
Dirk Gunsthövel - 25 Jun 2008 12:07 GMT
Hi,
thank you for your reply. I would happily see a around 10
minutes timeout.
The problem is that this stale client state remains the same forever.
... or at least 8 hours (longest patience interval someone had) which
is anyways too close to "forever".
My question is how to deal with this situation. It comes up with some
batch processes I run once in a while - leading to a defunc data
exchange and making it necessary to start the process again.
At a customer site when running about 10 processes in parallel
24/7 this happens about once a month - when they have a network
problem or alike. Its rare but its nasty.
Solutions include setting a query timeout or having a thread supervising
the whole thing.
I wonder if there is a standard way to deal with this.
Thanks again
Dirk
If this i using a TCP connection then you will need to wait for tcp to
timeout the connection via the "keepalive" mechanism
that is normally around 10 minutes. Read up to TCP keepalive and the
good reasons why the timeout is so high.
david@smooth1.co.uk - 26 Jun 2008 23:13 GMT
> Hi,
>
[quoted text clipped - 28 lines]
> that is normally around 10 minutes. Read up to TCP keepalive and the
> good reasons why the timeout is so high.
Enable tcp keepalive.