-->
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: DirtyCheck with Instrumentation - A Bug?
PostPosted: Thu Jan 05, 2012 8:52 am 
Beginner
Beginner

Joined: Fri Aug 29, 2003 4:26 am
Posts: 26
Location: Germany, Dortmund
Hi!

I am wondering if this code is a bug or can be optimized (Hibernate 3.6.8.Final):
Code:
public final class EntityEntry implements Serializable {
  public boolean requiresDirtyCheck(Object entity) {
    return isModifiableEntity() && (getPersister().hasMutableProperties() || !FieldInterceptionHelper.isInstrumented(entity) || FieldInterceptionHelper.extractFieldInterceptor(entity).isDirty());
  }

If my entity is modifiable and not mutable and instrumentized, then I want to return the result of isDirty().
I would expected something like:
Code:
  public boolean requiresDirtyCheck(Object entity) {
    if (!isModifiableEntity() || !getPersister().hasMutableProperties()) {
      return false;
    }
    if (FieldInterceptionHelper.isInstrumented(entity) && !FieldInterceptionHelper.extractFieldInterceptor(entity).isDirty()) {
      return false;
    }
    return true;
  }


Can someone give me a reason for the original implementation or is it a bug?

_________________
Bye
Kai


Top
 Profile  
 
 Post subject: Re: DirtyCheck with Instrumentation - A Bug?
PostPosted: Wed Jan 11, 2012 10:31 am 
Newbie

Joined: Tue Dec 19, 2006 11:05 am
Posts: 11
Another desirable improvement would be to let the field interceptor register a modified entity in a 'potential dirty' list. For those entities the dirty check does not even need to visit them all...


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.