Connection break during waiting for resultset - how to deal with?
Posted in 2008
Topics: General Discussion
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."
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
Dirk Gunsth'vel wrote: > 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 > Do you have a firewall in the middle? Regards.
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 "Sheshnarayan Agrawal" <shagrawal@in.ibm.com> schrieb im Newsbeitrag news:mailman.1265.1214110406.20610.informix-list@iiug.org... 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
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 -- -- 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."