Things I tried for connection pool problem overloading pool that DID not work:
I am using commons-pool-1.1.jar for pooling. I tried setting auto-commit to false; doing a "select" and then a commit, then closing my connection and I get a "null pointer exception". I have tried taglibs for pagination, but decided not to use them because they save the results in a session object and they are not flexible enough for what I need them for. The flow goes like this: query string gets sent to the ProcessSearchForm.jsp which set all the params in the SearchFormBean, then the ProcessSearchForm.jsp does a <jsp:forward page="SearchFormResultsPage.jsp"/> Which shows the results. From the SearchFormResultsPage.jsp I have links to the SearchFormPageBack.jsp and SearchFormPageForward.jsp for paging. Does anyone have a more successful way of doing pagination without a heavy MVC framework??????? Subject: Re: How should a connection pool act? Hmm.. sounds like you need to look at your pagination logic. I work with WebSphere. When you close a jdbc connection, WebSphere's connection pool logic is to "commit" any outstanding transactions and put the connection back into the pool. If you are hanging on to the "result set" between invocations for doing your "paging", you need to do something different. Examples: 1) Save first and last primary keys from the currently displayed "page" and use them to refine the query for the next "page". (this implies that you get a connection from the pool, do the query, close resultset, statement, and connection each time) 2) Save off all the data from the result set in a session object and do paging from that. I don't really recommend this. I am sure others will chime in with additional options. -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] Behalf Of Tom K Sent: Wednesday, May 05, 2004 10:50 AM To: [EMAIL PROTECTED] Subject: Re: How should a connection pool act? OK, I'm not closing the connection but I still have the problem. When I close the connection, pagination stops working. -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of Qureshi, Affan Sent: Wednesday, May 05, 2004 9:45 AM To: [EMAIL PROTECTED] Subject: Re: How should a connection pool act? Depends on your Connection pool implementation I believe. If you are using dbcp, it doesn't actually "close" the connection but returns it to the pool on conn.close(). Affan -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] Behalf Of Galbreath, Mark A Sent: Wednesday, May 05, 2004 9:39 AM To: [EMAIL PROTECTED] Subject: Re: How should a connection pool act? I don't think you do not want to close the connection if you are pooling. Mark -----Original Message----- From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 05, 2004 10:37 AM To: [EMAIL PROTECTED] Subject: How should a connection pool act? After submitting a form, which queries my database the results come back fine. If I keep resubmitting my form I get the error: "Cannot get a connection, pool exhausted". Should I get this error? Doesn't the submission use a single pool resource? Arhhhhh [EMAIL PROTECTED] Yea...I know, make sure your closing your connection! OOOhAhhhhh --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL 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 ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL 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 ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL 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 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL 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 The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.(A) ________________________________________________________________________ ___ To unsubscribe, send email to [EMAIL 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 --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003 ___________________________________________________________________________ To unsubscribe, send email to [EMAIL 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