Hello,
finally decided (in fact forced because of jar incompatibilities) to upgrade my webapp from hibernate 3.2.5.ga to 4.3.4-final.
this went rather smooth, only needed to change namespaces in config and mapping files (yes, still doing old-school mapping).
as part of my regression tests, i was creating a 'long' report in my webapp. with 3.2.5.ga this took ~15 seconds, with 4.3.4-final this takes ~45 seconds.
what did i check: + i enabled the sql statement logging: - the same number of statements was used in both cases - 1 type of statement changed (in 3.2.5 a 'left outer join' was used, in 4.3.4 a 'inner join' was used), i assume this is a hibernate optimization + i checked the cpu usage with top: with 3.2.5 mysqld uses up to 15%, while with 4.3.4 mysqld only uses up to 5%. tomcat is using in both cases close to 100% of 1 cpu => so bottleneck seems to be in java + i tried to replace the c3p0 jar that was packaged with hibernate (c3p0-0.9.2.1.jar) with a more recent one (c3p0-0.9.5-pre6.jar), but this has no effect
does this ring a bell or any suggestion on how to further investigate this?
below is my config file
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory> <!-- properties --> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:5555/bla-app?zeroDateTimeBehavior=convertToNull</property> <property name="hibernate.connection.username">foo</property> <property name="hibernate.connection.password">bar</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<!-- to be able to use true, false in HQL --> <property name="hibernate.query.substitutions"> true 1, false 0 </property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <property name="hibernate.c3p0.max_size">50</property> <property name="hibernate.c3p0.min_size">10</property> <property name="hibernate.c3p0.timeout">200</property> <property name="hibernate.c3p0.max_statements">0</property> <property name="hibernate.c3p0.acquire_increment">3</property> <!-- mapping files --> ...
</session-factory>
</hibernate-configuration>
|