Subject | RE: [Firebird-Java] 'Unable to complete network request' problem |
---|---|
Author | Natal Vande Casteele |
Post date | 2002-10-02T08:24:29Z |
Hello,
Using the latest driver sources, the problem has not gone away..
I've done some testing and if I run the following code in a servlet (using Tomcat 4), I can reproduce the problem:
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try
{
out.println("<html><body><head>");
out.println("<title>Test connection pooling</title></head>");
out.println("<body>");
out.println("Creating database<br>");
org.firebirdsql.jdbc.FBWrappingDataSource ds = new org.firebirdsql.jdbc.FBWrappingDataSource();
ds.setDatabaseName("127.0.0.1/3050:/opt/databases/testdb.gdb");
ds.setMinSize(3);
ds.setMaxSize(5);
ds.setBlockingTimeout(100);
ds.setIdleTimeout(1000);
ds.setPooling(true);
java.sql.Connection connection = ds.getConnection("sysdba", "masterkey");
connection.close();
}
catch (Exception e)
{
out.println("Exception: " + e);
}
out.println("Closing database<br>");
out.println("</body></html>");
From 'netstat -a | grep "gds"' I can see that the driver keeps spawning connections after every idletimeout interval (every 1 second), eventually saturating the server and generating the "Unable to complete network request to host '127.0.0.1'" and "FAIL: gds_db service_limit from=127.0.0.1" messages after subsequent calls to the servlet.
I'm really puzzled by this as Stefan Mühlemann reported the problem fixed and I've tried both with builds from a CVS source checkout and the 20020930 snapshot (which were exactly the same).
Greetings,
Natal Vande Casteele
-----Original Message-----
From: David Jencks [mailto:davidjencks@...]
Sent: maandag 30 september 2002 14:15
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] 'Unable to complete network request' problem
Using the latest driver sources, the problem has not gone away..
I've done some testing and if I run the following code in a servlet (using Tomcat 4), I can reproduce the problem:
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try
{
out.println("<html><body><head>");
out.println("<title>Test connection pooling</title></head>");
out.println("<body>");
out.println("Creating database<br>");
org.firebirdsql.jdbc.FBWrappingDataSource ds = new org.firebirdsql.jdbc.FBWrappingDataSource();
ds.setDatabaseName("127.0.0.1/3050:/opt/databases/testdb.gdb");
ds.setMinSize(3);
ds.setMaxSize(5);
ds.setBlockingTimeout(100);
ds.setIdleTimeout(1000);
ds.setPooling(true);
java.sql.Connection connection = ds.getConnection("sysdba", "masterkey");
connection.close();
}
catch (Exception e)
{
out.println("Exception: " + e);
}
out.println("Closing database<br>");
out.println("</body></html>");
From 'netstat -a | grep "gds"' I can see that the driver keeps spawning connections after every idletimeout interval (every 1 second), eventually saturating the server and generating the "Unable to complete network request to host '127.0.0.1'" and "FAIL: gds_db service_limit from=127.0.0.1" messages after subsequent calls to the servlet.
I'm really puzzled by this as Stefan Mühlemann reported the problem fixed and I've tried both with builds from a CVS source checkout and the 20020930 snapshot (which were exactly the same).
Greetings,
Natal Vande Casteele
-----Original Message-----
From: David Jencks [mailto:davidjencks@...]
Sent: maandag 30 september 2002 14:15
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] 'Unable to complete network request' problem
On 2002.09.30 04:11:05 -0400 Natal Vande Casteele wrote:
>
> Hi,
>
> I've updated rebuilt the driver with the latest source. I'll let you
> know if the problem reoccurs.
>
> Having full access to the server this morning, I found the following
> errors in /var/logs/secure concerning our database connection problem:
>
> [...]
> Sep 29 05:19:43 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 05:27:13 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 05:34:43 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 05:42:13 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 05:49:43 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 05:57:13 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 06:04:43 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 06:12:14 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> Sep 29 06:19:44 xinetd[1026]: FAIL: gds_db service_limit from=127.0.0.1
> [...]
>
> (repeated all during the night, ie an error every 7.5 minutes. In our
> java code, setIdleTimeoutMinutes is set to 15 minutes)
>
> According to the xinetd man page:
>
> service_limit
> the allowed number of server instances for this service would be
> exceeded
>
> Would this confirm the relation to the FBManagedConnection bug?
I think so.
david jencks
>
> Greetings,
> Natal Vande Casteele
>
> -----Original Message-----
> From: David Jencks [mailto:davidjencks@...]
> Sent: zaterdag 28 september 2002 21:25
> To: Firebird-Java@yahoogroups.com
> Subject: Re: [Firebird-Java] 'Unable to complete network request'
> problem
>
>
> This might be related to the FBManagedConnection bug. I think I fixed
> that
> so I'd appreciate your trying again with the driver from cvs. I would
> like
> a little testing before I release another binary.
>
> Thanks
> david jencks
>
> On 2002.09.28 10:55:37 -0400 natalvc wrote:
> > Hello,
> >
> > We've been experiencing a problem with the JBird driver in certain
> > conditions. We're running Tomcat 4, the latest version of the Classic
> > Firebird Server and the newest release candidate of JBird. We use the
> > built-in connection pooling mechanism via the FBWrappingDataSource
> > class which we access from all our servlets via a static variable
> > (the first servlet to access it, creates it).
> >
> > During 'normal' operation, i.e. fairly frequent calls to our servlets
> > and thus use of the DB connections, everything goes very smoothly. If
> > we leave the servlets running for a few hours, however, without calls
> > to them, and then make a call to one of them, we get the following
> > exception:
> >
> >
> > Problem getting connection: Unable to complete network request to
> > host "127.0.0.1".
> > java.sql.SQLException: Problem getting connection: Unable to complete
> > network request to host "127.0.0.1".
> > at org.firebirdsql.jdbc.FBDataSource.getConnection
> > (FBDataSource.java:107)
> > at org.firebirdsql.jdbc.FBSimpleDataSource.getConnection
> > (FBSimpleDataSource.java:251)
> >
> >
> > The Interbase server is still running since if we restart the Tomcat
> > server (and thus create a new FBWrappingDataSource class), everything
> > works again. We run several other servlets on the Tomcat server using
> > the InterClient driver and they keep functioning, even after very
> > long periods of idle time. So it doesn't seem to come down to a
> > network problem either.
> >
> > Now, we're not 100% sure that the problem is a result of long periods
> > of database inactivity but we do notice the exception everytime the
> > FBWrappingDataSource was active all night without calls to the
> > database. During day-time testing (with frequent calls) we haven't
> > noticed the problem. We've even stress tested our application with
> > thousands of HTTP calls and everything keeps working as intended.
> >
> > Any ideas what could be causing this? Perhaps the FBManagedConnection
> > bug recently mentioned on this list?
> >
> > Greetings,
> > Natal Vande Casteele
> >
> >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > Firebird-Java-unsubscribe@yahoogroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> >
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>
To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.