| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: connection pooling exception
Try getting the latest Oracle JDBC driver you can find (8.1.7 at least). There were some bugs in the eairlier releases of the pooling that got fixed in later releases. I used to see random hangs when trying to get connections in earlier versions. Also the statement pooling was broken, not sure if they have fixed it yet.
-Peter
Chris wrote:
>
> Hi,
>
> I am using java servlet and Oracle 8.1.6 database. I used the
> OracleConnectionCacheImpl class to achieve connection pooling. However,
> sometimes the application server will output the following exception. Is it
> becase that the pool is used up for any other reason? Any other better
> practice to do connection pooling using servlet?
>
> Thanks.
> Chris
>
> Exception:
> -----------
> <2001-12-1 12:45:23> <Error> <HTTP>
> <[WebAppServletContext(661879,DefaultWebApp_wbserver)]
> Servlet failed with Exception
> java.util.EmptyStackException
> at java.util.Stack.peek(Stack.java:82)
> at java.util.Stack.pop(Stack.java:64)
> at
> oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCac
> heImpl.java:183)
> at
> oracle.jdbc.pool.OracleConnectionCacheImpl.getConnection(OracleConnectionCac
> heImpl.java:157)
> at cwSQL.openDB(cwSQL.java:153)
> at aeAction.service(aeAction.java:101)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :213)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
> ntext.java:1265)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
> :1631)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
> Servlet class cwSQL Source Code :
> ---------------------------------------
> public class cwSQL
> {
> private static OracleConnectionCacheImpl ods = null;
>
> public void cwSQL() {;}
>
> public Connection openDB() {
> if (ods == null) {
> // Create a OracleConnectionPoolDataSource as an factory
> // of PooledConnections for the Cache to create.
> OracleConnectionPoolDataSource ocpds =
> new
> OracleConnectionPoolDataSource();
> ocpds.setURL("jdbc:oracle:thin:@"+ dbHost + ":" + dbPort
> + ":" + dbName);
> ocpds.setUser(usrNm);
> ocpds.setPassword(usrPw);
>
> // Associate it with the Cache
> ods = new OracleConnectionCacheImpl(ocpds);
>
> // Set the Max Limit
> ods.setMaxLimit (20);
> }
>
> con = ods.getConnection();
> }
> }
Received on Thu Dec 06 2001 - 07:24:45 CST
![]() |
![]() |