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.  [ 3 posts ] 
Author Message
 Post subject: Too many updates
PostPosted: Fri Apr 04, 2008 9:30 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
Customer concerned that saveing is too slow, so I started wondering what's wrong with it and marked Log4net NHibernate.SQL DEBUG mode.

And I found that In every save NHibernate generates sql update for every collection loaded in session?
What, why?
Probably there is something wrong in my configuration.

I'm using the ActiveRecord for mapping classes and application is winforms

Please advise?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 04, 2008 1:28 pm 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
What do you mean with save ? When you use hibernates Save(), Update() or SaveOrUpdate() functions on objects that are not in a session, hibernate execute the sql statements appropriate for the command, no matter if the objects really have changed or not.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 05, 2008 2:24 am 
Beginner
Beginner

Joined: Sun Oct 22, 2006 12:06 pm
Posts: 39
Thanks! I resolved by setting all log information on debug level on log4net and it turned out that since I inhherit every entity on BaseEntiy and in base entity I had property for last updated user, that got user name from static value.

If I removed this everything started working fine and updates were made only for those records that realy changed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.