0

I have a question related to hibernate connention managing/pooling.

If I write sessionFactory.openSession(), will hibernate create a fresh, new JDBC connection?

My C3PO properties look like this:

    <property name="hibernate.c3p0.acquire_increment">1</property>
    <property name="hibernate.c3p0.min_size">0</property>
    <property name="hibernate.c3p0.max_size">10</property>

2 Answers 2

2

If you got c3p0 configured properly, you will get a pooled connection (not a fresh one).

0
1

It will check the pool and if there is any open non-locked connection, then it will use that one. If all the connections in the pool are currently used or there is no connection, then it will open 1. If the connection pool contains 10 locked connection then it will give an exception

Not the answer you're looking for? Browse other questions tagged or ask your own question.