Spring calls the stored procedure and returns the cursor. When the cursor data exceeds the specified size of the connection pool, the connection pool explodes.

  java, question

1. A stored procedure in oracle collects data and saves it to the out cursor.
2. Call the stored procedure through spring and return the data.
3. The logical processing class inherits from StoredProcedure.
4. The connection pool explodes when the cursor data exceeds the specified size of the connection pool.

/*
* In spring’s code for calling stored procedures, there was no place to control connection pool from beginning to end, such as open and close.
*/

-The following are connection pool configuration related parameters-
maxActive=50
maxWait=20000
maxIdle=5

-The following are error messages-
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted

at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:103)
 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
 at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
 at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
 at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
 at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
 at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
 at org.hibernate.loader.Loader.doQuery(Loader.java:661)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
 at org.hibernate.loader.Loader.doList(Loader.java:2145)
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
 at org.hibernate.loader.Loader.list(Loader.java:2024)
 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
 at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
 at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
 at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1109)
 at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
 at org.springframework.orm.hibernate3.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:853)
 at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
 ... 82 more

Caused by: java.util.NoSuchElementException: Timeout waiting for idle object

at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:801)
 at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)

Spring will control the open and close of connection pool by itself.
Normally cursor data has nothing to do with connection pool size. It should be a code problem, check the code carefully.
It is really not possible to call stored procedures directly by jdbc. Manually control the opening and closing of the connection.