Ian Clarke a ?crit : > On Sun, Sep 7, 2008 at 8:51 AM, <batosai at freenetproject.org> wrote: >> Author: batosai >> Date: 2008-09-07 13:51:05 +0000 (Sun, 07 Sep 2008) >> New Revision: 22526 >> >> Modified: >> trunk/plugins/WoT/src/plugins/WoT/IdentityTest.java >> Log: >> Force a garbage collection before bringing db4o up. > > Is there a good reason for this? Most of what I read about forcing a > GC suggests that it normally does more harm than good, and is best > avoided.
The reason is that my first unit tests were telling me everything was OK, whereas it was obvioulsy not. I was simply closing the database and re-opening it just after. I then switched to two-time tests : First pass, I created/stored objects. Second pass, I fetched/checked them. This worked fine and allowed me to fix the problem. But then, WoT became an official plugin and I was told my tests should not leave traces after being run. So I switched back to one-time tests. Garbage collection is just a try to reproduce a real restart of the database. If this is a problem, I can remove it. After all, the problem is solved and I know how to avoid it : use SODA requests on anything that isn't trivial. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080908/8656bd46/attachment.pgp>
