arminw      2005/03/31 01:39:41

  Modified:    src/test/org/apache/ojb/odmg Tag: OJB_1_0_RELEASE
                        CollectionsTest.java
  Log:
  update comment
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.9  +12 -8     db-ojb/src/test/org/apache/ojb/odmg/CollectionsTest.java
  
  Index: CollectionsTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/CollectionsTest.java,v
  retrieving revision 1.13.2.8
  retrieving revision 1.13.2.9
  diff -u -r1.13.2.8 -r1.13.2.9
  --- CollectionsTest.java      18 Mar 2005 21:08:52 -0000      1.13.2.8
  +++ CollectionsTest.java      31 Mar 2005 09:39:40 -0000      1.13.2.9
  @@ -329,20 +329,24 @@
           if(ojbSkipKnownIssueProblem("Issue using proxies with circular 
references and a non-global-shared cache")) return;
   
           /*
  -        Say we have an object with circular reference
  -        A1 -1:1-> B1 -1:n-> [A1,C]
  +        Say we have an object with circular reference (A has a 1:1 reference 
to B
  +        and B has a 1:n collection reference to A)
  +        A1 -1:1-> B1 -1:n-> [A1,A4]
           and the 1:n is a collection proxy.
   
           Now user lookup A1 and get [EMAIL PROTECTED]>[EMAIL 
PROTECTED]>[EMAIL PROTECTED] He wants to
  -        remove the C object in the 1:n reference in [EMAIL PROTECTED] 
Because B has an
  +        remove the A4 object in the 1:n reference in [EMAIL PROTECTED] 
Because B has an
           proxy collection, the proxy materialize on
  -        B.getC's().remove(1) ==> remove C
  +        B.getA's().remove(1) ==> remove A4
           call.
           While materialization of the collection proxy OJB lookup again an A1 
instance.
  -        Because the previous materialzed [EMAIL PROTECTED] instance isn't in 
the cache, so OJB
  -        lookup a new instance for A1 ==> [EMAIL PROTECTED] and a new [EMAIL 
PROTECTED]
  +        When the previous materialzed [EMAIL PROTECTED] instance isn't in 
the session
  +        cache (e.g. A1 was used in a previous session), OJB lookup the real 
cache.
  +        If the real cache is "empty" or works with copies of persistent 
objects (TLCache)
  +        new instance for A1 ==> [EMAIL PROTECTED] and a new [EMAIL 
PROTECTED] will be materialized.
   
  -        Thus we have [EMAIL PROTECTED] --> [EMAIL PROTECTED] -->[EMAIL 
PROTECTED]@22[-->[EMAIL PROTECTED]>[EMAIL PROTECTED] !!!!
  +        Thus we have after the remove of A4 with materialized proxy:
  +        [EMAIL PROTECTED] --> [EMAIL PROTECTED] -->[EMAIL 
PROTECTED]@22[-->[EMAIL PROTECTED]>[EMAIL PROTECTED] !!!!
           Needless to say this will cause problems on update.
   
           The workaround for the odmg-api is shown in test 
#testWithBackReference_2,
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to