I'm using Spring, Hibernate for CRUD procedures and taking advantage of Apache 'BasicDataSource' for connection pooling Now the issue is when use below following configuration in datasource

    <property name="maxActive" value="100"/>
    <property name="maxWait" value="10000"/>
    <property name="removeAbandoned" value="true"/>
    <property name="removeAbandonedTimeout" value="60"/>
    <property name="logAbandoned" value="true"/>
    <property name="maxIdle" value="10"/>

than after using all connections I m getting Error of "Connection totally reset on log" however it takes very long time to obtain back.

And when I m getting rid of following lines from datasource

   <property name="removeAbandoned" value="true"/>
    <property name="removeAbandonedTimeout" value="60"/>
    <property name="logAbandoned" value="true"/>

And adding below line to SessionFactory(hibernateProperties)

    <prop key="hibernate.connection.release_mode">after_statement</prop>

than i getting no error on console the main problem could it be uses the bond and close the moment it completes.