-->
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.  [ 5 posts ] 
Author Message
 Post subject: Commit too slow
PostPosted: Wed Feb 10, 2010 6:20 am 
Newbie

Joined: Wed Feb 10, 2010 6:10 am
Posts: 3
A commit of this object (see mapping) takes 2 seconds. I enabled the sql-logger, just one sql-statement is executed:

NHibernate: UPDATE controlpropert SET Name = ?p0, ID_Ref = ?p1, ValueType = ?p2, Value = ?p3, ID_RefRole = ?p4, ID_RefControl = ?p5 WHERE ID = ?p6; ?p0 = 'xxx', ?p1 = '1004640', ?p2 = 'xxx', ?p3 = 'xxx', ?p4 = '68', ?p5 = '4663', ?p6 = '43'

Is this normal?

For FlushMode I tried different settings, currently I set it to "Auto".
Are there any other settings which could influence the runtime of the commit-statement?

This is my hibernate-configuration:
Code:
  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <bytecode-provider type="lcg"/>
    <reflection-optimizer use="true"/>
    <session-factory>     
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
      <property name="connection.connection_string">
        Server=xxxx;database=xxxx;port=3306;User Id=xxxx;Password=xxxx
      </property>
      <property name="dialect">NHibernate.Dialect.MySQLDialect</property>
      <property name="default_schema">dresden</property>

      <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property>
      <property name="cache.use_minimal_puts">true</property>
      <property name="cache.use_query_cache">true</property>
      <property name="query.startup_check">false</property>
      <property name="command_timeout">0</property>
      <property name="show_sql">false</property>
      <property name="use_outer_join">true</property>
    </session-factory>
  </hibernate-configuration>


The mapping of the saved object:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="ControlProperty" table="controlproperty" dynamic-insert="false" dynamic-update ="false" >
  <cache usage="read-write"/>
<id name="ID" column="ID" type="Int32" unsaved-value="0">
<generator class="identity" />
</id>
<property name="Name" column="Name" type="String" length="50" />
<property name="ID_Ref" column="ID_Ref" type="int"/>
<property name="ValueType" column="ValueType" type="String" length="50" />
<property name="ValueByte" column="Value" type="Byte[]"/>
<many-to-one name="Role" column="ID_RefRole" class="Role"  cascade="none"/>
<many-to-one name="Control" column="ID_RefControl" class="Control" cascade="none"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: Commit too slow
PostPosted: Wed Feb 10, 2010 7:09 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
NHibernate: UPDATE controlpropert SET Name = ?p0, ID_Ref = ?p1, ValueType = ?p2, Value = ?p3, ID_RefRole = ?p4, ID_RefControl = ?p5 WHERE ID = ?p6; ?p0 = 'xxx', ?p1 = '1004640', ?p2 = 'xxx', ?p3 = 'xxx', ?p4 = '68', ?p5 = '4663', ?p6 = '43'


If it is really the update-statement to take 2 seconds (you can verify it making some stacktrace with jstack),
then the cause has to be found on the database:
- Maybe the index on controlpropert.ID is missing or is not considered in the execution plan
- Maybe the database waits until locks hold by other sessions are released


Top
 Profile  
 
 Post subject: Re: Commit too slow
PostPosted: Mon Feb 22, 2010 9:14 am 
Newbie

Joined: Wed Feb 10, 2010 6:10 am
Posts: 3
Do you have any more information for using jstack for StackTrace for a VB.NET application?

With "SHOW FULL PROCESSLIST;" I could not see any locked table in MySQL. I also tried the explain-command for some tables to see if the indicies are used, and they are used.

Any further idea?


Top
 Profile  
 
 Post subject: Re: Commit too slow
PostPosted: Mon Feb 22, 2010 9:31 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
Do you have any more information for using jstack for StackTrace for a VB.NET application?


Sorry, I forget that here we are in NHibernate forum and not in Hibernate forum.
I fear that with VB.NET it is not possible to do this.


Top
 Profile  
 
 Post subject: Re: Commit too slow
PostPosted: Wed Feb 24, 2010 6:27 am 
Newbie

Joined: Wed Feb 10, 2010 6:10 am
Posts: 3
No one any further ideas? :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.