Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
multiple connections made when only 1 needed

multiple connections made when only 1 needed

2004-09-16       - By Mary Collamore

 Back
Reply:     1     2  

We are running JRun 3.1 build 51002, and using JRun connection pooling.
Metrics will show over 2000 connections used, with active = 0 idle = 0.  No
problems.   But sometimes, the following will appear in event log:

19:07:49 metrics (JRun) ... Connection Pool: Total [active=0 idle=1
used=47] myDB [active=0 idle=1 used=47] ...
19:08:16 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:17 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:18 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:19 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:20 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:31 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:33 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:36 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:37 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:38 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName
19:08:38 info (JRun) (myDB) Creating JDBC connection to
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName

There is no reason so many connections should have been made, at most 1 was
needed.  This bumps up the active connections.

metrics now:
19:07:49 metrics (JRun) ... Connection Pool: Total [active=12 idle=0
used=60] myDB [active=12 idle=0 used=60] ...

Then a while later often see:
19:13:50 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:51 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:52 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:53 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:54 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:55 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:56 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:57 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:58 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:13:59 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:14:00 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.
19:14:01 info (JRun) (myDB)Removing JDBC connection
jdbc:sybase:Tds:myHostName:1234?SERVICENAME=myDsName due to timeout even
though connection is still in use.

Now the idle connections go into negative numbers, and we end up with
metrics that look like:
19:14:49 metrics (JRun) ... Connection Pool: Total [active=12 idle=-10
used=65] myDB[active=12 idle=-10 used=65] ..

Often followed by multiple cases of:
19:14:02 error (jcp) Connection reset by peer: JVM_recv in socket input
stream read [java.net.SocketException: Connection reset by peer: JVM_recv
in socket input stream read]
java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read

This happens several times, and the active / idle get up into the 40's.
The database then becomes unresponsive.  Sometimes users report error "All
threads are blocked"  Not good !

We are saying connection.close() to return it to the pool each time a new
connection has been gotten from the pool. Note that number of connected
users in the Sybase database only showed 1, when the metrics had 12 active
connections.
I wrote earlier about our servlet Init being called multiple times, and was
given suggestion to drop the "implements SingleThreadModel", which I have
done.
That has solved the multiple init problem, but still get the above.
Does any have any thoughts on what would make it run just fine for hours,
then go nuts and create all these extra connections? We can't seem to
correlate it with anything showing in the logs, and don't know what to look
at next to trouble shoot this.
Any help appreciated.  Thanks....

__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
To unsubscribe, send email to listserv@(protected) and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

©2008 junlu.com - Jax Systems, LLC, U.S.A.