1

The version Jboss 6.4.21EAP with Hibernate: 4.2.21.Final in spite of opening and closing the sessions (finally clause), creates connections INACTIVE/idle in our database Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

Next I put our configuration in hibernate

<property name="hibernate.generate_statistics">false</property>
<property name="hibernate.jdbc.batch_size">30</property>
<property name="hibernate.order_inserts">true</property>
<property name="hibernate.order_updates">true</property>
<property name="hibernate.jdbc.batch_versioned_data">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.datasource">jdbc/myapp</property>
<property name="hibernate.connection.release_mode">auto</property>
public void  addApplication (Application application) {
        Session session = MyAppSessionFactory.getSessionFactory().openSession();
        try {
            session.beginTransaction();
            session.save(application);
            session.getTransaction().commit();
        } catch (Exception e) {
            logger.error("Error in addApplication: ", e);
            session.getTransaction().rollback();
        } finally {
            session.close();
        }
    }

From what we have seen Hibernate retains the connection in the JBoss pool, and obviously the problem is when the maximum defined in our pool-size is reached, the application has this exception:

Log on Jboss

javax.resource.ResourceException: IJ000655: No managed connections available within configured blocking timeout (60000 [ms])

Logs on Oracle enter image description here

Apparently it seems a leak of database connections in code, but we have reviewed our code a thousand times and all connections open and close properly.

We have seen this other post, and we have tried to put the parameter to AFTER_TRANSACTION and we have seen a strange behavior also, the application does not have the error: ResourceException: IJ000655 anymore, but in the database we have the same number of connections IDLE == to our max jboss pool size, but the application can still connect when in theory it should not ...

This behavior is a BUG of Jboss with that version of Hibernate?

Despite the strange behavior with Hibernate Release Mode = after_transaction, is it advisable to change the default mode release?

reizintolo
  • 429
  • 2
  • 7
  • 20

0 Answers0