If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix JDBC Timeout

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-03, 13:42
aelius aelius is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Informix JDBC Timeout

Hello,

I'm currently evaluating different JDBC drivers for use with Informix, and am having problems setting a connection timeout for the IBM driver. As I far as I know, there are two ways of doing this, either by using DriverManager.setLoginTimeout(60); (which works perfectly with the DataDirect and the MS SQL Server drivers) or setting INFORMIXCONTIME in the URL. Neither one of these works. The URL I'm using is:

jdbc:informix-sqli://10.8.24.65:1547/gute:INFORMIXSERVER=dgtcp;user=XXX;password=XXX;IN FORMIXCONTIME=8

Does anyone know why?

Thanks in advance,
Aelius
Reply With Quote
  #2 (permalink)  
Old 12-04-03, 16:58
Amit Dandekar Amit Dandekar is offline
Registered User
 
Join Date: Oct 2003
Posts: 29
Not sure why DriverManager::setLoginTimeout() does not work ...
I tried to look for it in the code for java.sqlDriverManager class
but DriverManagers does not seem to do anything with loginTimeout
which is being set.

DriverManager is class which is implemented by Sun or respective
JVM vendor and not by JDBC driver vendor.


As far as INFORMIXCONTIME is concerned ,
there seems to be a bug in informix JDBC driver.

This bug is likely to be fixed in upcoming release of JDBC driver
(JDBC 2.21.JC6 .. mostly)

As of now , INFORMIXCONTIME sets the time between
connection attempts rather than setting connection time out.
You can use INFORMIXCONRETRY to set number of times
you want the JDBC driver to attempt establishing a connection before it
throws exception , when a connection is attempted.

For example , if INFORMIXCONRETRY is 5 and
INFORMIXCONTIME is 10 ,
on calling DriverManager.getConnection()
JDBC driver will atempt to open a connection .
suppoe first attempt fails because of whatever reason ,
(something like server too busy to accept new connections)
JDBC driver shall wait for 10 sec and retry connection.
JDBC driver shall do same for 5 times with interval of
10 sec before it throws an exception regarding not being able to
open a connection.
Reply With Quote
  #3 (permalink)  
Old 12-08-03, 05:35
aelius aelius is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Thank you for the answer.

Seems like the only way to go around the problem is by creating the connection in a thread and let the thread time out.

Regards,
Aelius

Quote:
Originally posted by Amit Dandekar
Not sure why DriverManager::setLoginTimeout() does not work ...
I tried to look for it in the code for java.sqlDriverManager class
but DriverManagers does not seem to do anything with loginTimeout
which is being set.

DriverManager is class which is implemented by Sun or respective
JVM vendor and not by JDBC driver vendor.


As far as INFORMIXCONTIME is concerned ,
there seems to be a bug in informix JDBC driver.

This bug is likely to be fixed in upcoming release of JDBC driver
(JDBC 2.21.JC6 .. mostly)

As of now , INFORMIXCONTIME sets the time between
connection attempts rather than setting connection time out.
You can use INFORMIXCONRETRY to set number of times
you want the JDBC driver to attempt establishing a connection before it
throws exception , when a connection is attempted.

For example , if INFORMIXCONRETRY is 5 and
INFORMIXCONTIME is 10 ,
on calling DriverManager.getConnection()
JDBC driver will atempt to open a connection .
suppoe first attempt fails because of whatever reason ,
(something like server too busy to accept new connections)
JDBC driver shall wait for 10 sec and retry connection.
JDBC driver shall do same for 5 times with interval of
10 sec before it throws an exception regarding not being able to
open a connection.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On