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.  [ 1 post ] 
Author Message
 Post subject: NHibernate performance problem
PostPosted: Tue Apr 15, 2008 8:02 am 
Newbie

Joined: Fri Jan 05, 2007 5:36 am
Posts: 16
Hi,

I'm having some trouble with my NHibernate right now.
My database stores information about what an respondent answered on a survey.

It can be up to 20 000 answer sets so it's pretty much information.

Each answer set contains information about what was answered on each question and there can be around 300-400 questions in worst case.

Here is the mapping files:

This is a mapping file for an AnswerSet object. It's a collection of all
questions answered by one respondent.
There is also some diffirent types of questions that we need to have.


Code:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping
  xmlns="urn:nhibernate-mapping-2.2"
  assembly="EsMaker.Entities"
  namespace="EsMaker.Entities">
  <class name="AnswerSet" table="[Result].[SurveyAnswerSet]">
   
    <id name="Id" column="ID" type="Int32" unsaved-value="0">
      <generator class="native" />
    </id>

    <many-to-one name="Respondent" class="SpecializedRespondent" column="SurveyPublicationRecipientId" />

    <property name="PublicationId" column="SurveyPublicationId" type="int" />   
    <property name="StartTime" column="DateStamp" type="DateTime" />
    <property name="WorkTime" type="int" />
    <property name="Completed" type="Boolean" />
    <property name="Paused" type="Boolean" />
    <property name="Simulated" type="Boolean" />

    <bag name="BasicAnswers" access="property" table="Result.SurveyAnswerBasic" lazy="false">
      <key column="SurveyAnswersetId" />
      <one-to-many class="BasicAnswer" />
    </bag>

    <bag name="MatrixAnswers" access="property" table="Result.SurveyAnswerMatrix" lazy="false">
      <key column="SurveyAnswersetId" />
      <one-to-many class="MatrixAnswer" />
    </bag>

    <bag name="DropDownMatrixAnswers" access="property" table="Result.SurveyAnswerMatrix3D" lazy="false">
      <key column="SurveyAnswersetId" />
      <one-to-many class="DropDownMatrixAnswer" />
    </bag>

    <bag name="TextAnswers" access="property" table="Result.SurveyAnswerText" lazy="false">
      <key column="SurveyAnswersetId" />
      <one-to-many class="TextAnswer" />
    </bag>

  </class>
</hibernate-mapping>



The problem is that I need to load all of this information and it needs to be pretty fast. As it is now it takes a lot of time to load the information for these sets. How can I optimize it for best performance? Is it possible to get good performance out of this? Should I change to ADO.NET for this part?



Cheers,
Yagami


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

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.