Re: [Modeling-users] unloading CustomObjects
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-07-22 19:11:31
|
Yannick Gingras <yan...@sa...> wrote: > Hi ! >=20 > Once the object is loaded in an EditingContext, is there a way to unload = it ? >=20 > I don't want to kick it from the DB, just free some RAM... There is > forgetObject() but the doc told not to use it. First: you're completely right, forgetObject() is for internal use only. You need EditingConext.refaultObject(). Don't search your local copy, it does not have it; I was sure this was implemented, and it is... but not where I first expected to find it. Check the ml archives:; (this was in march) https://sourceforge.net/mailarchive/forum.php?thread_id=3D1884326&forum_id= =3D10674 I've quickly checked the implementation & at the test I proposed there, so here is my suggestion: you can use it as-is, given that: - you're not applying it on deleted, inserted or modified objects, (BTW: it will become an error to refault a deleted or an inserted object) - you stick to EC.refaultObject and do not try to call DBContext.refaultObject - you do not use it with a nested ec. (I'm not saying this won't work, it probably will... but it needs to be tested before I can say this is supported). This request comes up on a regular basis, I guess I should consider integrating it in the core. Any other vote for this, anyone? -- S=E9bastien. |