Hi All,
During a load test opening and starting several session/transaction sequentially i have a regular deterioration of the begin transaction operation. In detail:
To simulate a specific workflow of my app and to verify the performance of such workflow against the db i concentrated the hugest operation in a single method of a thread. In this method i open and close 3 session, i start and commit 3 transactions sequentially and starting 50 paralel threads i have a sistematic deterioration(+1 sec. per each) of the first(1/3) beginTransaction.
A little Code Example:
The following con is runned paralel in N threads
Session sess; Transaction tx; try { sess = factory.openSession(); //1/3 it takes less or more N+0,5/1 sec (1sec, 2sec....Nsec) tx = sess.beginTransaction(); //do some work tx.commit();
sess = factory.openSession(); //2/3 it takes 0 sec tx = sess.beginTransaction(); //do some work tx.commit();
sess = factory.openSession(); //3/3 it takes 0 sec tx = sess.beginTransaction(); //do some work tx.commit(); }catch.......
and please find below my hibernate framework cfg file:
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory name="mercurius"> <!-- Database connection settings -->
<!-- configurazione per oracle -->
<property name="connection.provider_class">org.jasypt.hibernate.connectionprovider.EncryptedPasswordDriverManagerConnectionProvider</property> <property name="connection.encryptor_registered_name">configurationHibernateEncryptor</property> <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@IP:1521:SID</property> <property name="connection.password">ENC(*****************)</property>
<property name="connection.username">admin_platform</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property> <property name="current_session_context_class">thread</property> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> <property name="show_sql">true</property>
<property name="c3p0.acquire_increment">10</property> <property name="c3p0.idle_test_period">10</property> <property name="c3p0.max_statements">0</property> <property name="c3p0.min_size">50</property> <property name="c3p0.timeout">10</property> <property name="c3p0.max_size">100</property>
</session-factory>
</hibernate-configuration>
Do you have eny explanation for such behaviour?
Thanks,
Carlo
|