db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/odmg CollectionsTest.java
Date Thu, 31 Mar 2005 09:39:41 GMT
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 A1@11->B1@12-->[proxy@]. He wants to
  -        remove the C object in the 1:n reference in B@12. Because B has an
  +        remove the A4 object in the 1:n reference in B@12. 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 A1@11 instance isn't in the cache, so OJB
  -        lookup a new instance for A1 ==> A1@22 and a new B1@44
  +        When the previous materialzed A1@11 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 ==> A1@22 and a new B1@44 will be materialized.
   
  -        Thus we have A1@11 --> B1@12 -->proxy@[A1@22[-->B1@44]-->A1@22] !!!!
  +        Thus we have after the remove of A4 with materialized proxy:
  +        A1@11 --> B1@12 -->proxy@[A1@22[-->B1@44]-->A1@22]] !!!!
           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: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message