I am using JDBC driver 2.20JC2 and connecting to IDS 7.23 SQLEXEC from the Tomcat 4.1.12 servlet engine. My connections are dynamically created per request thread and closed immediately at end of thread processing.

Ocassionally I experience a delay from the DriverManager.getConnection() function which blocks all servlet threads that are requesting a connection.

My URL is pretty basic (has the dbname, usr, & pass) and looks like this:

jdbc:informix-sqli://my-sun-host:1525/my_dbname:INFORMIXSERVER=prod_tcp, UNAME=my_uname, pass=my_pass

The ( netstat -a ) command shows that the servlet engine has one (1) established socket connection to SQLEXEC. The thread dump of Tomcat shows that the servlet engine has one (1) thread (Thread-53 below) that has passed further up in the DriverManager.getConnection() function, called recvConnectionResponse(), and is trying to read a short Int from SQLEXEC:

"Thread-53" daemon prio=1 tid=0x839e998 nid=0x254f runnable [0x543fe000..0x543ff890]
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream. java:85)
at java.io.BufferedInputStream.fill(BufferedInputStre am.java:181)
at java.io.BufferedInputStream.read1(BufferedInputStr eam.java:220)
at java.io.BufferedInputStream.read(BufferedInputStre am.java:275)
at com.informix.asf.IfxDataInputStream.readFully(IfxD ataInputStream.java:149)
at com.informix.asf.IfxDataInputStream.readSmallInt(I fxDataInputStream.java:428)
at com.informix.asf.IfxDataInputStream.readShort(IfxD ataInputStream.java:441)
at com.informix.asf.Connection.recvConnectionResponse (Connection.java:751)
at com.informix.asf.Connection.<init>(Connection.java :471)
at com.informix.jdbc.IfxSqliConnect.<init>(IfxSqliCon nect.java:576)
at java.lang.reflect.Constructor.newInstance(Native Method)
at com.informix.jdbc.IfxDriver.connect(IfxDriver.java :194)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:172)

All other request threads in the servlet are appearently being blocked by this one thread shown above, and do not get any further in DriverManager.getConnection():

"Thread-60" daemon prio=1 tid=0x83a3cc8 nid=0x2569 waiting for monitor entry [0x551fe000..0x551ff890]
at java.sql.DriverManager.getConnection(DriverManager .java:159)
at cwp.BalanceInqTrx.DoQry_(BalanceInqTrx.java:419)

"Thread-59" daemon prio=1 tid=0x83a3158 nid=0x2568 waiting for monitor entry [0x54ffe000..0x54fff890]
at java.sql.DriverManager.getConnection(DriverManager .java:159)
at cwp.BalanceInqTrx.DoQry_(BalanceInqTrx.java:419)

"Thread-58" daemon prio=1 tid=0x83a2688 nid=0x2567 waiting for monitor entry [0x54dfe000..0x54dff890]
at java.sql.DriverManager.getConnection(DriverManager .java:159)
at QueryResults.<init>(QueryResults.java:165)

When Thread-53 finally completes the socket read, a valid connection is returned. Also, at this time the others threads waiting on DriverManager.getConnection() receive valid connections and continue. The connections returned after the delay are always valid and function properly.

The delay can be anywhere between 20 to 300 seconds. Usually it is 1 minute.
It is not specific to one database either as the servlet accesses different databases depending on the client request.

There is no transaction contexts (Begin Work, Commit..) in use by the servlet either in one or multiple databases.

When problem occurs, the servlet does not have any active connections executing any SQL.

It has occurred at heavy and light load..

The frequency of occurrence is rare ( once a week maybe ), but the thread dump ALWAYS shows 1 thread in a socket read as is Thread 53 above..

Does anybody know why this occurs?, What can possible be holding up SQLEXEC?, Could it be a bug in the Ifx JDBC Driver?

Any feedback is greatly appreciated..