From: <no...@so...> - 2000-10-20 20:29:27
|
Bug #113428, was updated on 2000-Sep-02 06:58 Here is a current snapshot of the bug. Project: Firebird Category: InterClient Status: Open Resolution: None Bug Group: None Priority: 5 Summary: timeout in ib doesn't notify interclient Details: After a connection has been idle for a certain amount of time Interbase disconnects without InterClient being notified. This causes an exception the next time any kind of remote operation is performed, and makes the Connection worthless ( for obvious reasons ). I think would should implement a 'reconnect' parameter in the Connections parameters to specify whether or not we want it to automatically reconnect if a dead connection is detected. This is already being done in MySQL's JDBC driver. Since JDBC doesn't have a detection method to check the validity of the connection, this is the only option I see as pheasible. Follow-Ups: Date: 2000-Sep-04 00:23 By: TorstenWel Comment: I tried to reproduce the disconnects - no luck. I was able to have an idle connection for long periods of time (more than 9 hours) without getting disconnected. Here's what I did: static public void main (String args[]) { interbase.interclient.DataSource dataSource = new interbase.interclient.DataSource(); dataSource.setDatabaseName("c:/program files/Borland/InterBase/examples/database/employee.gdb"); java.sql.Connection c = null; try { c = dataSource.getConnection("sysdba","masterkey"); } catch (java.sql.SQLException connectionFailure) { System.out.println("connection failed: " + connectionFailure); return; } int timeout = 1000; //let's start with one second while (true) { //forever until we hit an exception or kill the vm //first let's wait... try { Thread.sleep(timeout); System.out.println("connection was idle for " + timeout/1000 + " seconds"); } catch (Exception uhoh) { System.out.println("failed to wait?!: " + uhoh); return; } timeout *= 2; //next time we try it double the time; try { java.sql.Statement stmt = null; java.sql.ResultSet results = null; try {//do a dummy db access stmt = c.createStatement(); results = stmt.executeQuery("Select count(*) from JOB"); results.next(); } finally { if (results != null) results.close(); if (stmt != null) stmt.close(); } } catch (java.sql.SQLException e) { System.out.println("sql exception: " + e.getMessage()); if (c != null) { try { c.close(); } catch (java.sql.SQLException ignore) {} } return; } } } After "connection was idle for 32768 seconds" I gave up... Maybe it's platform dependant? I'm under NT, which OS do you use? Regards, Torsten ------------------------------------------------------- Date: 2000-Sep-04 07:56 By: Directrix1 Comment: Well, I'm running InterClient/InterServer/Interbase on one Linux machine. If you could run your test on a Linux box ( if you have one ) I would appreciate it. Edward ------------------------------------------------------- Date: 2000-Sep-04 14:38 By: Directrix1 Comment: I ran your little program, and it showed a disconnect after the 4096 second marker, which coincides with my exact disconnect time of 64 minutes. I only have access to this linux box, so you might need to try to run it on one around where you are. ------------------------------------------------------- Date: 2000-Sep-06 04:08 By: TorstenWel Comment: I don't have a (working) Linux box here, but I asked Mark O'Donohue to try it. He is out of town for some days and will do it as soon as he is back. Could you post the exception stack trace of the disconnect error? Thanks, Torsten ------------------------------------------------------- Date: 2000-Sep-06 10:49 By: none Comment: Here is the output of your program on my linux box: connection was idle for 2048 seconds connection was idle for 4096 seconds sql exception: [interclient][interbase] Unable to complete network request to host "localhost". Error reading data from the connection. Connection reset by peer It didn't print out a stack trace, but here is a stack trace from my Enhydra applet which is suffering from this same timeout problem: - Error in .InLabTracking - Reason: class interbase.interclient.SQLException: [interclient][interbase] Unable to complete network request to host "localhost". Error reading data from the connection. Connection reset by peer Java Call Stack: interbase.interclient.SQLException: [interclient][interbase] Unable to complete network request to host "localhost". Error reading data from the connection. Connection reset by peer at interbase.interclient.RecvMessage.createSQLException(Unknown Source) at interbase.interclient.RecvMessage.makeSQLException(Unknown Source) at interbase.interclient.RecvMessage.get_EXCEPTIONS(Unknown Source) at interbase.interclient.Statement.remote_EXECUTE_QUERY_STATEMENT(Unknown Source) at interbase.interclient.Statement.executeQuery(Unknown Source) at com.lutris.appserver.server.sql.standard.StandardDBConnection.executeQuery(StandardDBConnection.java, Compiled Code) at inLabTracking.presentation.SeniorShippingLog.runConnected(SeniorShippingLog.java, Compiled Code) at inLabTracking.presentation.ConnectedPO.runAuthenticated(ConnectedPO.java, Compiled Code) at inLabTracking.presentation.AuthenticatedPO.run(AuthenticatedPO.java, Compiled Code) at com.lutris.appserver.server.httpPresentation.HttpPresentationManager.runPresentationObj(HttpPresentationManager.java, Compiled Code) at com.lutris.appserver.server.httpPresentation.HttpPresentationManager.Run(HttpPresentationManager.java, Compiled Code) at com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.serviceDirect(HttpPresentationServlet.java, Compiled Code) at com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.service(HttpPresentationServlet.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java, Compiled Code) at org.apache.tomcat.core.ServletWrapper.handleInvocation(ServletWrapper.java, Compiled Code) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code) at org.apache.tomcat.core.Context.handleRequest(Context.java, Compiled Code) at org.enhydra.servlet.servletManager.ServletManager.service(ServletManager.java, Compiled Code) at org.enhydra.servlet.connectionMethods.http.HttpHandler.doARequest(HttpHandler.java, Compiled Code) at org.enhydra.servlet.connectionMethods.http.HttpHandler.processRequests(HttpHandler.java, Compiled Code) at org.enhydra.servlet.connectionMethods.http.HttpHandler.run(HttpHandler.java, Compiled Code) at java.lang.Thread.run(Thread.java, Compiled Code) I can't tell if thats InterClient throwing the Exception or InterServer. Both of them are on the same Linux box. Edward Flick ------------------------------------------------------- Date: 2000-Sep-06 12:33 By: Directrix1 Comment: I believe the problem may actually be with the linux version of interbase/firebird's gds library. Here is what I get when I run netstat before, the error occurs: Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 124 0 localhost:1164 localhost:gds_db ESTABLISHED tcp 0 0 localhost:interserver localhost:1163 ESTABLISHED tcp 0 0 localhost:1163 localhost:interserver ESTABLISHED Notice that it shows a connection from InterServer to Interbase, but not from InterBase to InterServer. This shows that InterBase has terminated its connection with InterServer. Just an observation. Edward Flick ------------------------------------------------------- Date: 2000-Sep-07 06:38 By: Directrix1 Comment: Well, I ran another test. This time I made my Enhydra app use my NT boxes InterServer by proxy. When I do this the connection stays open. Therefore, it is most definetly a problem with either: * Linux Interbase gds libs or * Linux InterServer InterClient is ruled out because its still using the linux box's version, and InterBase itself is ruled out, because it stays connected. Here is the connection string I put into my enhydra app on the linux box (CDF) to proxy through my NT box (Directrix1): jdbc:interbase://Directrix1/cdf:/dbs/tracking.gdb ------------------------------------------------------- Date: 2000-Sep-08 04:17 By: TorstenWel Comment: If that's possible you could try to use a non-InterClient/InterServer connection, i.e. another JDBC driver. If the problem persists then you know that it is a problem with Linux InterBase rather than InterServer. (or am I missing something?) Torsten ------------------------------------------------------- Date: 2000-Sep-08 06:29 By: Directrix1 Comment: Do you know of any other JDBC driver for InterBase? Edward Flick ------------------------------------------------------- Date: 2000-Sep-10 22:52 By: TorstenWel Comment: You could try the JDBC-ODBC bridge using one of the available ODBC drivers, no? Torsten ------------------------------------------------------- Date: 2000-Sep-11 10:29 By: none Comment: I'd rather stick to straight JDBC ------------------------------------------------------- Date: 2000-Sep-11 22:16 By: TorstenWel Comment: Of cause I didn't recommend the JDBC-ODBC bridge for a production setup. In any case it should be good enough to test it against the disconnect problem and verify if it's a problem with Linux InterBase rather than InterServer. Torsten ------------------------------------------------------- Date: 2000-Sep-11 22:17 By: TorstenWel Comment: Of cause I didn't recommend the JDBC-ODBC bridge for a production setup. In any case it should be good enough to test it against the disconnect problem and verify if it's a problem with Linux InterBase rather than InterServer. Torsten ------------------------------------------------------- Date: 2000-Sep-12 16:31 By: none Comment: where can I get a copy of an ODBC driver for linux? ------------------------------------------------------- Date: 2000-Sep-12 22:17 By: TorstenWel Comment: ftp://ftp.easysoft.com/pub/beta/interbase/ ------------------------------------------------------- Date: 2000-Sep-22 07:28 By: Directrix1 Comment: I think the problem is with either Linux gds libs or Interbase there is no way to tell this without someone looking into the InterBase source. ------------------------------------------------------- Date: 2000-Oct-20 13:29 By: webnative Comment: Interbase SuperServer closes InterServer connection after an hour of no activity; thus causing any new InterClient request to fail. The problem is found only in the following version: Interbase SS 6.0.1 Linux version only InterClient 1.6 Linux version only ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=113428&group_id=9028 |