-->
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: Dynamic-update attribute without select-before-update
PostPosted: Thu Dec 13, 2007 1:10 am 
Beginner
Beginner

Joined: Tue Sep 11, 2007 5:57 am
Posts: 36
It seems like dynamic-update attribute doesn't work without select-before-update attribute.

I have an entity named Person. Person has an column named AddressUid
, that refers to AddressUid of Address table.

now I retrieve one object of Person as

Person Per = Context.FindUnique("PersonUid=''");

Then I change the LastName of the Person as
Per.LastName = "Abcd";

Then I save the object to the database

as Contect.Save(Pers).

The changes are reflected to the database , but the profiler shows an update query fired on the Address table as well , even when I didn't do any changes to the Entity Address.

but everything works fine when I use select-before-update="true", and obviously this fires select query on Person and Address.
Does dynamic-update work without select-before-update?

Also to reduce the overhead caused by the select queries due to select-before-update="true", I enable second level cache but unfortunately NHibernate didn't look into it while updating the object. It hit the cache when I simply use _session.Get<Person>(1), but not internally when I use _session.SaveOrUpdate(objPerson).

Any idea why does it not hit the cache?


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.