Skip to Content.
Sympa Menu

grouper-dev - Re: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction

Subject: Grouper Developers Forum

List archive

Re: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction


Chronological Thread 
  • From: Arnaud Deman <>
  • To: Chris Hyzer <>
  • Cc: Grouper Dev <>
  • Subject: Re: [grouper-dev] dbVersionDifferentFields and getAttributeOrNull interraction
  • Date: Tue, 17 Feb 2009 17:39:11 +0100
  • Organization: GIP RECIA

Chris,
It works fine !

Thanks again,
Arnaud.



Chris Hyzer a écrit :

Arnaud, thanks for the detailed test case.  Sorry, this is a bug.

 

https://bugs.internet2.edu/jira/browse/GRP-225

 

I fixed this in grouper 1.4 branch, can you get the latest from CVS?

 

cvs -d:pserver::/home/cvs/i2mi login

 

cvs -d:pserver::/home/cvs/i2mi export -r GROUPER_1_4_BRANCH grouper

 

 

There is a test case in grouper and the issue is fixed, now it works.

 

It is a little complex.

 

1. The dbVersion (clone of data) is snapshotted when an object is retrieved from the DB

2. The group attributes (including extension) are not part of the group object, they are a one to many.  Note that in grouper 1.5 the extension is moving to not be an attribute, and is part of the group object.

3. The group attributes are lazy loaded.  So what was occurring was the group was retrieved with null attributes initially, that was copied to the dbVersion, then later on the attributes were lazy loaded from the DB, but the dbVersion of the attributes were never updated (still null).  This is why reading an attribute changed the state of things

4. I changed it so that when the attributes are lazy loaded, if the dbVersion has a null attribute map, it will get updated to whatever was retrieved from the DB.  The test case now works.

 

I believe there is still an issue though, if you read the attributes of the dbVersion and never read the attributes of the real object (not sure why you would do that), I think things would still be out of sync.  I documented that in the Group dbVersion javadoc.  I believe we could figure out a way to link the dbVersion and real object further to fix this issue, but I think the complexity involved to do that for the payoff is not worth it.

 

I will say that the attribute hook would be less complex, so it might be better to use... but not in this case for extension since in 1.5 you will have to move it back to group hook anyway :)

 

Let me know if this works for you.

 

Regards,

Chris



-- 

Arnaud Deman
GIP RECIA
Parc d'activités les Aulnaies
151 rue de la Juine - 45160 OLIVET
Tel : 02 38 42 14 63 




Archive powered by MHonArc 2.6.16.

Top of Page