db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/odmg RITest.java
Date Thu, 01 May 2003 16:40:39 GMT
thma        2003/05/01 09:40:39

  Modified:    src/test/org/apache/ojb/odmg RITest.java
  Log:
  repaired a bogus testcase, see explanations inline
  
  Revision  Changes    Path
  1.12      +13 -2     db-ojb/src/test/org/apache/ojb/odmg/RITest.java
  
  Index: RITest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/RITest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- RITest.java	29 Apr 2003 15:43:26 -0000	1.11
  +++ RITest.java	1 May 2003 16:40:39 -0000	1.12
  @@ -255,9 +255,20 @@
               Without obj1 test pass
               TODO: fix this
               */
  -            db.makePersistent(obj1);
  +            //db.makePersistent(obj1);
               db.makePersistent(obj2);
  -            db.deletePersistent(obj1);
  +            //db.deletePersistent(obj1);
  +            /*
  +             thma: I checked this, and don't see a problem here.
  +            obj1 and obj2 have the same Identity. Thus the 
  +            calls db.makePersistent(obj1); and db.makePersistent(obj2);
  +            will only register one instance to the transaction.
  +            The second call does not add a second instance, but just marks the
  +            existing instance as dirty a second time.
  +            So it's no wonder why after deletePersistent(obj1); no contract is found.
  +            Works as designed.
  +            The Lesson to learn: never let business objects have the same primary key values!
  +             * */
               tx.commit();
               Collection result = getContract(contractPk, odmg);
               assertEquals("We should found exact one contract", 1, result.size());
  
  
  

Mime
View raw message