Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: 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

  2. #2
    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.

  3. #3
    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

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •