I cut my example data to one object and revisited the log messages again.
In the Hibernate-only case I see these lines in the log:
Code:
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:42) - Using Hibernate built-in connection pool (not for production use!)
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:43) - Hibernate connection pool size: 1
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:77) - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://141.***:3306/myDB?relaxAutoCommit=true
INFO net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:78) - connection properties: {user=xx, password=xx}
INFO net.sf.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:33) - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:84) - total checked-out connections: 0
DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:100) - opening new JDBC connection
DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:106) - created connection to: jdbc:mysql://141.***:3306/myDB?relaxAutoCommit=true, Isolation Level: 4
DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider.closeConnection(DriverManagerConnectionProvider.java:120) - returning connection to pool, pool size: 1
However, using the Spring way, these lines shrink to two messages:
Code:
INFO net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:53) - Initializing connection provider: org.springframework.orm.hibernate.LocalDataSourceConnectionProvider
INFO net.sf.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:33) - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
Note: the first line is different, the second line appears in the middle of the first log excerpt.
My applicationServer.xml has the following property:
Code:
<property name="configLocation">
<value>hibernate.cfg.xml</value>
</property>
so Hibernate's configuration should be equal in both scenarios, shouldn't it?
Could this be the cause for the observed performance difference?
Oliver