You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Luminous Heart <lu...@yahoo.com> on 2002/08/19 18:53:52 UTC
Craig, PoolMan, latest version WAS the problem.
Ok. I reverted to an older version of PoolMan, where
we use pool.prop instead of pool.xml. That version
works fine. I have not hit the exception although I
tested it for sometime.
Does that mean am stuck to the older poolman? Is there
a better solution to handle database pooling?
Thank you.
--- Luminous Heart <lu...@yahoo.com> wrote:
> I am sorry, but I did not get what you mean with
> connection limit to be a hard limit, which one is
> that?
>
> I am including a copy of my pool.xml if you care do
> point out what should be changed.
>
> Thank you in advance.
>
> ==================== Pool.xml =====================
> <?xml version="1.0" encoding="UTF-8"?>
>
> <poolman>
>
> <management-mode>local</management-mode>
>
> <datasource>
>
> <!-- ============================== -->
> <!-- Physical Connection Attributes -->
> <!-- ============================== -->
>
> <!-- Standard JDBC Driver info -->
>
> <dbname>webdev</dbname>
> <jndiName>webdev</jndiName>
> <driver>org.postgresql.Driver</driver>
>
> <url>jdbc:postgresql://localhost:6093/webdev</url>
>
> <username>JustAUserName</username>
> <password>JustAUserNamePassword</password>
>
> <!-- Oracle needs this to be set to true -->
> <nativeResults>true</nativeResults>
>
> <minimumSize>1</minimumSize>
> <maximumSize>10</maximumSize>
> <connectionTimeout>600</connectionTimeout>
> <userTimeout>12</userTimeout>
> <shrinkBy>10</shrinkBy>
>
>
>
<logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> <debugging>false</debugging>
>
> <!-- Query Cache Attributes-->
>
> <cacheEnabled>false</cacheEnabled>
> <cacheSize>20</cacheSize>
> <cacheRefreshInterval>120</cacheRefreshInterval>
>
> </datasource>
>
> </poolman>
>
> ==================== End Pool.xml =================
> --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > Actually now that I think about it more that might
> > be the cause of the null
> > pointer (but
> > probably not). In your poolman.xml file have you
> > set the connection limit
> > to be a hard
> > limit? If you timeout on connections (user
> timeout)
> > is fairly high you
> > could run out of
> > connections, and it might return a "null" instead
> of
> > a connection.
> >
> > But that's just a guess. Also, you might was to
> > also turn on logging (debug
> > level) in
> > poolman as well so that you can watch the
> > connections getting checked out
> > and in.
> >
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> >
> > > -----Original Message-----
> > > From: Luminous Heart
> > [mailto:luminousheart@yahoo.com]
> > > Sent: Monday, August 19, 2002 8:36 AM
> > > To: Tomcat Users List
> > > Subject: Re: It would be great IF somebody
> > answered me, ONCE, for change
> > > :(
> > >
> > >
> > > Hi Graig,
> > > Here is my jsp file. I am not sure what might be
> > > wrong. Although the same error happens in a
> bigger
> > > application in a tc cluster of 3 tomcats. Two of
> > these
> > > tcs fail while one does not get any forwards
> after
> > > that.
> > >
> > > Please take a look at my code, if you do not
> mind.
> > >
> > > Best regards.
> > >
> > > ===================== JSP =====================
> > > <%@ page import="java.io.*" %>
> > > <%@ page import="java.util.*" %>
> > > <%@ page import="java.text.*" %>
> > >
> > > <%@ page import="java.util.Properties" %>
> > > <%@ page import="java.util.Date" %>
> > >
> > > <%@ page contentType="text/html"%>
> > >
> > > <%@ page import="com.codestudio.util.*"%>
> > > <%@ page import="java.sql.*"%>
> > >
> > > <!-- %@ include file="no-cache.jsp" % -->
> > >
> > > <form action="UserAccount.jsp" method=post
> > > name="access_form">
> > > <table width="90%" align="center">
> > > <tr>
> > > <th bgcolor="#CCCCFF" colspan=3>
> > <font
> > > size=5>User Access</font></th>
> > >
> > > <td> </td>
> > > <td> </td>
> > > <td> </td>
> > > </tr>
> > > <tr>
> > > <td>
> > > <center>
> > > <table cellpadding=4 cellspacing=2
> > border=0>
> > > <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>User Access by userid</font></th>
> > > <tr bgcolor="#c8d8f8">
> > > <td valign=top colspan=2> <b>User
> > > Name</b><br>
> > > <input type="text"
> > name="byusername"
> > > size=25 value="" maxlength=25>
> > > </td>
> > > </tr>
> > > </table>
> > > </center>
> > > </td>
> > > <td>
> > > <center>
> > > <table cellpadding=4 cellspacing=2
> > border=0>
> > > <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>User Access by Date</font><font
> > size=1></font>
> > > </th>
> > > <tr bgcolor="#c8d8f8">
> > > <td valign=top> <b>Date</b><br>
> > > <input type="text" name="bydate"
> > > value="" size=25 maxlength=125>
> > > <br>
> > > </td>
> > > </tr>
> > > </table>
> > > </center>
> > > </td>
> > > <td>
> > > <center>
> > > <table cellpadding=4 cellspacing=2
> > border=0>
> > > <th bgcolor="#CCCCFF" colspan=2>
> <font
> > > size=5>USER Access by IP Address</font>
> > > </th>
> > > <tr bgcolor="#c8d8f8">
> > > <td valign=top> <b>IP
> > Address</b><br>
> > > <input type="text"
> > name="byipaddress"
> > > value="" size=25 maxlength=125>
> > > <br>
> > > </td>
> > > </tr>
> > > </table>
> > > </center>
> > > </td>
> > > </tr>
> > > <tr>
> > > <td> </td>
> > > <td align="center" bgcolor="#c8d8f8">
> > > <input type="submit" value="Submit"
> > > name="submit">
> > > </td>
>
=== message truncated ===
__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Craig, PoolMan, latest version WAS the problem.
Posted by Andrew Conrad <an...@attbi.com>.
Instead of using poolman, you could use dbcp. It's the default
connection pool for TC 4.1.x
http://jakarta.apache.org/commons/dbcp.html
- Andrew
> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 12:54 PM
> To: Tomcat Users List
> Subject: Craig, PoolMan, latest version WAS the problem.
>
>
> Ok. I reverted to an older version of PoolMan, where
> we use pool.prop instead of pool.xml. That version
> works fine. I have not hit the exception although I
> tested it for sometime.
>
> Does that mean am stuck to the older poolman? Is there
> a better solution to handle database pooling?
>
> Thank you.
>
> --- Luminous Heart <lu...@yahoo.com> wrote:
> > I am sorry, but I did not get what you mean with
> > connection limit to be a hard limit, which one is
> > that?
> >
> > I am including a copy of my pool.xml if you care do
> > point out what should be changed.
> >
> > Thank you in advance.
> >
> > ==================== Pool.xml =====================
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <poolman>
> >
> > <management-mode>local</management-mode>
> >
> > <datasource>
> >
> > <!-- ============================== -->
> > <!-- Physical Connection Attributes -->
> > <!-- ============================== -->
> >
> > <!-- Standard JDBC Driver info -->
> >
> > <dbname>webdev</dbname>
> > <jndiName>webdev</jndiName>
> > <driver>org.postgresql.Driver</driver>
> >
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> >
> > <username>JustAUserName</username>
> > <password>JustAUserNamePassword</password>
> >
> > <!-- Oracle needs this to be set to true -->
> > <nativeResults>true</nativeResults>
> >
> > <minimumSize>1</minimumSize>
> > <maximumSize>10</maximumSize>
> > <connectionTimeout>600</connectionTimeout>
> > <userTimeout>12</userTimeout>
> > <shrinkBy>10</shrinkBy>
> >
> >
> >
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> > <debugging>false</debugging>
> >
> > <!-- Query Cache Attributes-->
> >
> > <cacheEnabled>false</cacheEnabled>
> > <cacheSize>20</cacheSize>
> > <cacheRefreshInterval>120</cacheRefreshInterval>
> >
> > </datasource>
> >
> > </poolman>
> >
> > ==================== End Pool.xml =================
> > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that might
> > > be the cause of the null
> > > pointer (but
> > > probably not). In your poolman.xml file have you
> > > set the connection limit
> > > to be a hard
> > > limit? If you timeout on connections (user
> > timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null" instead
> > of
> > > a connection.
> > >
> > > But that's just a guess. Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > >
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might be
> > > > wrong. Although the same error happens in a
> > bigger
> > > > application in a tc cluster of 3 tomcats. Two of
> > > these
> > > > tcs fail while one does not get any forwards
> > after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> > mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post name="access_form">
> > > > <table width="90%" align="center">
> > > > <tr>
> > > > <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > > <td> </td>
> > > > <td> </td>
> > > > <td> </td>
> > > > </tr>
> > > > <tr>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by userid</font></th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top colspan=2> <b>User Name</b><br>
> > > > <input type="text"
> > > name="byusername"
> > > > size=25 value="" maxlength=25>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > > </th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top> <b>Date</b><br>
> > > > <input type="text" name="bydate"
> > > > value="" size=25 maxlength=125>
> > > > <br>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>USER Access by IP Address</font>
> > > > </th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top> <b>IP
> > > Address</b><br>
> > > > <input type="text"
> > > name="byipaddress"
> > > > value="" size=25 maxlength=125>
> > > > <br>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > </tr>
> > > > <tr>
> > > > <td> </td>
> > > > <td align="center" bgcolor="#c8d8f8">
> > > > <input type="submit" value="Submit"
> > > > name="submit">
> > > > </td>
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For
> additional commands,
> e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Craig, PoolMan, latest version WAS the problem.
Posted by Mike Jackson <mj...@cdi-hq.com>.
Did you try using a soft limit? That combined with a larger
scavenge count and a shorter time limit on the connections
(not the user time limit) should allow you to scale decently.
Also you really should check the connection to be sure that
it's not a null connection prior to using it. That should
also elminate the problem, but you'd have to add some code
to handle when it's not there (retry acquiring a connection
most likely).
--mikej
-=-----
mike jackson
mjackson@cdi-hq.com
> -----Original Message-----
> From: Luminous Heart [mailto:luminousheart@yahoo.com]
> Sent: Monday, August 19, 2002 9:54 AM
> To: Tomcat Users List
> Subject: Craig, PoolMan, latest version WAS the problem.
>
>
> Ok. I reverted to an older version of PoolMan, where
> we use pool.prop instead of pool.xml. That version
> works fine. I have not hit the exception although I
> tested it for sometime.
>
> Does that mean am stuck to the older poolman? Is there
> a better solution to handle database pooling?
>
> Thank you.
>
> --- Luminous Heart <lu...@yahoo.com> wrote:
> > I am sorry, but I did not get what you mean with
> > connection limit to be a hard limit, which one is
> > that?
> >
> > I am including a copy of my pool.xml if you care do
> > point out what should be changed.
> >
> > Thank you in advance.
> >
> > ==================== Pool.xml =====================
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <poolman>
> >
> > <management-mode>local</management-mode>
> >
> > <datasource>
> >
> > <!-- ============================== -->
> > <!-- Physical Connection Attributes -->
> > <!-- ============================== -->
> >
> > <!-- Standard JDBC Driver info -->
> >
> > <dbname>webdev</dbname>
> > <jndiName>webdev</jndiName>
> > <driver>org.postgresql.Driver</driver>
> >
> > <url>jdbc:postgresql://localhost:6093/webdev</url>
> >
> > <username>JustAUserName</username>
> > <password>JustAUserNamePassword</password>
> >
> > <!-- Oracle needs this to be set to true -->
> > <nativeResults>true</nativeResults>
> >
> > <minimumSize>1</minimumSize>
> > <maximumSize>10</maximumSize>
> > <connectionTimeout>600</connectionTimeout>
> > <userTimeout>12</userTimeout>
> > <shrinkBy>10</shrinkBy>
> >
> >
> >
> <logFile>/usr/local/tomcat/logs/poolman.log</logFile>
> > <debugging>false</debugging>
> >
> > <!-- Query Cache Attributes-->
> >
> > <cacheEnabled>false</cacheEnabled>
> > <cacheSize>20</cacheSize>
> > <cacheRefreshInterval>120</cacheRefreshInterval>
> >
> > </datasource>
> >
> > </poolman>
> >
> > ==================== End Pool.xml =================
> > --- Mike Jackson <mj...@cdi-hq.com> wrote:
> > > Actually now that I think about it more that might
> > > be the cause of the null
> > > pointer (but
> > > probably not). In your poolman.xml file have you
> > > set the connection limit
> > > to be a hard
> > > limit? If you timeout on connections (user
> > timeout)
> > > is fairly high you
> > > could run out of
> > > connections, and it might return a "null" instead
> > of
> > > a connection.
> > >
> > > But that's just a guess. Also, you might was to
> > > also turn on logging (debug
> > > level) in
> > > poolman as well so that you can watch the
> > > connections getting checked out
> > > and in.
> > >
> > > --mikej
> > > -=-----
> > > mike jackson
> > > mjackson@cdi-hq.com
> > >
> > > > -----Original Message-----
> > > > From: Luminous Heart
> > > [mailto:luminousheart@yahoo.com]
> > > > Sent: Monday, August 19, 2002 8:36 AM
> > > > To: Tomcat Users List
> > > > Subject: Re: It would be great IF somebody
> > > answered me, ONCE, for change
> > > > :(
> > > >
> > > >
> > > > Hi Graig,
> > > > Here is my jsp file. I am not sure what might be
> > > > wrong. Although the same error happens in a
> > bigger
> > > > application in a tc cluster of 3 tomcats. Two of
> > > these
> > > > tcs fail while one does not get any forwards
> > after
> > > > that.
> > > >
> > > > Please take a look at my code, if you do not
> > mind.
> > > >
> > > > Best regards.
> > > >
> > > > ===================== JSP =====================
> > > > <%@ page import="java.io.*" %>
> > > > <%@ page import="java.util.*" %>
> > > > <%@ page import="java.text.*" %>
> > > >
> > > > <%@ page import="java.util.Properties" %>
> > > > <%@ page import="java.util.Date" %>
> > > >
> > > > <%@ page contentType="text/html"%>
> > > >
> > > > <%@ page import="com.codestudio.util.*"%>
> > > > <%@ page import="java.sql.*"%>
> > > >
> > > > <!-- %@ include file="no-cache.jsp" % -->
> > > >
> > > > <form action="UserAccount.jsp" method=post
> > > > name="access_form">
> > > > <table width="90%" align="center">
> > > > <tr>
> > > > <th bgcolor="#CCCCFF" colspan=3>
> > > <font
> > > > size=5>User Access</font></th>
> > > >
> > > > <td> </td>
> > > > <td> </td>
> > > > <td> </td>
> > > > </tr>
> > > > <tr>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by userid</font></th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top colspan=2> <b>User
> > > > Name</b><br>
> > > > <input type="text"
> > > name="byusername"
> > > > size=25 value="" maxlength=25>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>User Access by Date</font><font
> > > size=1></font>
> > > > </th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top> <b>Date</b><br>
> > > > <input type="text" name="bydate"
> > > > value="" size=25 maxlength=125>
> > > > <br>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > <td>
> > > > <center>
> > > > <table cellpadding=4 cellspacing=2
> > > border=0>
> > > > <th bgcolor="#CCCCFF" colspan=2>
> > <font
> > > > size=5>USER Access by IP Address</font>
> > > > </th>
> > > > <tr bgcolor="#c8d8f8">
> > > > <td valign=top> <b>IP
> > > Address</b><br>
> > > > <input type="text"
> > > name="byipaddress"
> > > > value="" size=25 maxlength=125>
> > > > <br>
> > > > </td>
> > > > </tr>
> > > > </table>
> > > > </center>
> > > > </td>
> > > > </tr>
> > > > <tr>
> > > > <td> </td>
> > > > <td align="center" bgcolor="#c8d8f8">
> > > > <input type="submit" value="Submit"
> > > > name="submit">
> > > > </td>
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>