db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armin Waibel" <armin.wai...@code-au-lait.de>
Subject Re: cvs commit: db-ojb/src/test/org/apache/ojb/odmg RITest.java
Date Thu, 01 May 2003 16:58:41 GMT
ugh!
> The Lesson to learn: never let business objects have the
> same primary key values!

The Lesson to learn: Read the repository metadata before
changing test cases you don't written yourself.

Thanks Thomas!

regards,
Armin


----- Original Message -----
From: <thma@apache.org>
To: <db-ojb-cvs@apache.org>
Sent: Thursday, May 01, 2003 6:40 PM
Subject: cvs commit: db-ojb/src/test/org/apache/ojb/odmg RITest.java


> 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);
>   +            file://db.makePersistent(obj1);
>                db.makePersistent(obj2);
>   -            db.deletePersistent(obj1);
>   +            file://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());
>
>
>
>
> ---------------------------------------------------------------------
> 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