-->
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: tx.commit sehr langsam
PostPosted: Fri Feb 15, 2008 12:29 pm 
Newbie

Joined: Fri Feb 15, 2008 12:13 pm
Posts: 15
Hibernate version: NHibernate 1.2.0.4000

hibernate.cfg.xml:

Code:
<?xml version='1.0' encoding='utf-8'?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
   <!-- an ISessionFactory instance -->
   <session-factory>
      <!-- properties -->
      <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
      <property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
      <property name="connection.connection_string">Server=XX;Data Source=XX;User ID=XX;Password=XX;</property>
      <property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
   </session-factory>
</hibernate-configuration>


Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="Umm.Poco.UmmMessage, Umm" table="tb_umm_msg">
      <id name="Umm_msg_id">
         <column name="UMM_MSG_ID" not-null="true"/>
         <generator class="sequence">
            <param name="sequence">SQ_UMM_MSG</param>
         </generator>
      </id>
<many-to-one name="Event_" class="Umm.Poco.Event, Umm" column="FK_EVENT" not-null="true" cascade="save-update"/>
</class>
</hibernate-mapping>


Name and version of the database you are using: Oracle 9


Hallo,
ich schreibe ungefähr 70 Datensätze aus einer Liste in die DB. Dabei sind ~ 50 Instanzen von UmmMessage und ~ 20 Instanzen von UmmEvent.

Im Code rufe ich die obige methode mit einer List<UmmMessage> auf. Die zugehörigen UmmEvents werden durch cascade="save-update" ggf. mit gespeichert.

Problem: das ganze dauert > 5 Sekunden.
Warum? Zuerst hatte ich für jeden Datensatz der liste eine eigene Session/Transaktion, da war es noch langsamer.


Ist NHibernate generell langsam, wenn cascade Funktionalität verwendet wird? Muss ich andere Treiber verwenden?


Vielen Dank :o)
buchstaben


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 16, 2008 5:25 am 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Aktivier doch mal sql logging, damit man erstmal sieht, was genau hibernate tut.

_________________
Please rate useful posts.


Schauderhaft: Softwaredevelopment, Projectmanagement, Qualitymanagement and all things "schauderhaft"


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.