Shilpa,
 
What OS are you running this configuration on?  If it is AIX I would investigate to 
see how the system is configured for the number of processes per user on the system.  
If it is configured as a Workstation it is defaulted to 128 processes / login.  If it 
is configured as a server it is set to 500 processes / login.  Plus Oracle support 
site suggests in the neighborhood of 2500 processes / login for Oracle 9i to function 
well if you are running 9i.  These are all system settings that can be found in smitty 
on the system and adjusted as root user.
 
Hope this helps,
 
Cary

Shilpa Nalgonda <[EMAIL PROTECTED]> wrote:
Can someone please suggest how to achieve connection Pooling in tomcat 4.1.
As per the docs i have
1) configured server.xml to include the resource parameters ( datasource,
connection pool size etc)
2) In application code , retrieve connection using datasource
3) Every Method call to database retrieves connection
using datasource.getConnection ()
and closes connection everytime

But still the pooling is not achieved, i get ORA-00020 error( maximim
proceses exceeded), i increased the size from 30 to 200) even then it is not
working.

Can someone please help----

-----Original Message-----
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 12:55 PM
To: Tomcat Users List
Subject: org.apache.commons.dbcp.SQLNestedException: Cannot get a
connection, pool exhausted, cause:


Hi, I am getting the timeout exception for connection pooling, i am using
Tomca 4.1 and datasource to retrieve connections.
I am attaching all the soure code and configuration files used in my
application, please suggest where iam doing wrong...

SEVERE: getConnection()--SQLException
org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool
exhausted, cause:
java.util.NoSuchElementException: Timeout waiting for idle object
at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
l.java:801)
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:140)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5
18)
at
com.mypublisher.oemapi.DAO.DBAccess.getConnection(DBAccess.java:47)
at com.mypublisher.oemapi.DAO.Persister.(Persister.java:46)
at
com.mypublisher.oemapi.SubmitOrder.SubmitOrder(SubmitOrder.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.xmlrpc.Invoker.execute(Invoker.java:168)
at
org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:123)
at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:185)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:151)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:128)
at
com.mypublisher.oemapi.xmlrpc.XmlRpcServlet.doPost(XmlRpcServlet.java
============================================================================
===========
server.xml
---------
xmlrpc-oemapi-->
debug="5" reloadable="true" crossContext="true" useNaming="true">

prefix="localhost_rpcoemapi_log." suffix=".txt"
timestamp="true"/>
auth="Container"
type="javax.sql.DataSource"/>




factory
org.apache.commons.dbcp.BasicDataSourceFactory



         configure your mysqld max_connections large enough to handle
         all of your db connections. Set to 0 for no limit.
         -->


maxActive
5



         Set to 0 for no limit.
         -->


maxIdle
2



         in ms, in this example 10 seconds. An Exception is thrown if
         this timeout is exceeded.  Set to -1 to wait indefinitely.
         -->


maxWait
10000






username
ioeadmin




password
ioeadmin






driverClassName
oracle.jdbc.driver.OracleDriver



         The autoReconnect=true argument to the url makes sure that the
         mm.mysql JDBC Driver will automatically reconnect if mysqld closed
the
         connection.  mysqld by default closes idle connections after 8
hours.
         -->


url
jdbc:oracle:thin:@ipaddress:1521:MYDB





============================================================================
===================================
DatasourceFactory is a singleton class used to retrieve the datasource from
tomcat using JNDi..and connection is obtained from datasource...
public static DataSource getInstance() throws SystemException
{
if (!isDataSrcAvaliable)
{
if (dataSource == null)
{
new DataSourceFactory();
doLookUp();
isDataSrcAvaliable = true;
} //end if (dataSource == null)
}// end if (!isDataSrcAvaliable)
return dataSource;
} /* end getInstance() */

doLookUp method does this:
Context ctx = new InitialContext();
String dataSrc =
msgResource.getMessage(OEMAPIConstants.DATA_SOURCE_NAME);
Context env = (Context)ctx.lookup("java:comp/env");
dataSource = (DataSource) env.lookup(dataSrc);


public static Connection getConnection() throws DAOException
{
DataSource ds = (DataSource) DataSourceFactory.getInstance();
Connection con = ds.getConnection();
return ds.getConnection();
}
and every database lookup class, gets this connection and closes the
connection after the query to database...



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




                
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!

Reply via email to