Unable to open connection

I am developing an application with a very large load (request). I used the following technologies in my applications:

  • Jpa / hibernate as persistense layer
  • Spring and Spring Dao
  • C3p0 as pooling

my problem: I run my application when the number of requests increases, throws an exception in persistense that "Cannt open connection" I increase the oracle max session, but my problem is not resolved I hide the C3p0 document and check its parameters, but my problem is not solved.

Thank you for your attention.

+4
source share
2 answers

You have increased the maximum sessions in Oracle, but you have not increased the maximum connection pool size. An exception tells you that your pool is exhausted. Either find out which connections are holding and release them sooner, or increase the number of active connections in the pool.

+3
source

Is it possible to publish Spring configuration for your DataSource. I would expect something like:

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/> <property name="jdbcUrl" value="${jdbc.connection.url}"/> <property name="user" value="${jdbc.connection.username}"/> <property name="password" value="${jdbc.connection.password}"/> <property name="initialPoolSize" value="5"/> <property name="minPoolSize" value="5"/> <property name="maxPoolSize" value="100"/> </bean> 

Using another bean, where the data source is passed by reference:

 <bean id="mySampleDao" class="com.example.dao.MySampleDao"> <property name="dataSource" ref="dataSource" /> </bean> 

Is that what you have?

What version of Oracle are you using?

0
source

All Articles