-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Performance Problem using Hibernate via Spring
PostPosted: Fri Oct 01, 2004 5:14 am 
Newbie

Joined: Wed Sep 29, 2004 10:36 am
Posts: 8
Location: Berlin, Germany
Hibernate version:
2.1.6
(both Spring 1.1 and 1.1.1)

I've a problem when using Hibernate via Spring: the overall performance of a single saveOrUpdate() decreased significantly from ca 500ms to ca 9s.

I've asked already on the Spring forum (see http://forum.springframework.org/viewtopic.php?t=1049), but still don't have a solution for this problem.

I addition to the details posted there, I've figured out that the same behaviour happens with a JNDI provided data source under Tomcat, i.e. it seems that it is not a problem with my data source.

Has anybody seen something like this or an idea, where to look for the reason?

BTW: Both Hibernate debug logs are slightly different in size (261Kb fast versus 285Kb slow), but it's hard for me to identify the differences.

Any help is appreciated,
Oliver


Top
 Profile  
 
 Post subject: follow-up
PostPosted: Fri Oct 01, 2004 8:27 am 
Newbie

Joined: Wed Sep 29, 2004 10:36 am
Posts: 8
Location: Berlin, Germany
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.