-->
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.  [ 4 posts ] 
Author Message
 Post subject: Turn off dirty tracking
PostPosted: Thu Feb 23, 2006 11:23 am 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
I'm wondering... is there a way to inhibit dirty tracking and automated saving with NH?

It could be usefull to explicitly mark and entity to be saved rather than saving it automatically, and I'm not taling about evicting the object because lazy loading should be available.

This way it would be easier for a custom layer above NH to validate all data because there would be no danger to edit an entity and forget to validate it.

If there is how do cascades work in such a case?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2006 4:30 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
It's not exactly what you are asking for, but you can set ISession.FlushMode to FlushMode.Never, then the session will not execute flushes until you explicitly tell it to. (Except for entities which use identity id generation.)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 4:12 am 
Regular
Regular

Joined: Tue Mar 15, 2005 12:38 pm
Posts: 73
Location: Bucharest
Yap it's not _exactly_.

What I want is to be able to acknowledge saving for each and every entity whether transient or persistent...there's not way...right ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 5:36 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
Can you simply put whatever logic you want in IInterceptor.FindDirty()? From what I understand, that method lets you decide for each entity in the session's cache, whether it should be saved/updated by the impending flush. Is this what you want?


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