I have an application running in weblogic that uses c3p0 connection pooling. All the session.close() calls are in finally blocks in the application. When the app runs under load, the database connections exceed the max defined number in the connection pool (eg: connection shown to database server are 275, but max defined limit is 20).
Code:
<property name="hibernate.connection.url">
jdbc:oracle:thin:@<host>:1521:<sid>
</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">passwd</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">50</property>
// create session
sessionFactory = cfg.buildSessionFactory();
Session session = sessionFactory.openSession();
Questions: how does the app exceed the max connections in pool (goes up to appx 300)? Would using weblogic datasource instead help?
Appreciate any responses.