Cleaning up old domain objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cleaning up old domain objects

Rob Rothwell
I seem to have old versions of my domain object (PatientData) that Aida seems to be holding on to so I can't garbageCollect them.  I have done SwazooAida stop and garbageCollected, but the PointerFinder tool still finds that they exist as illustrated below:

Pointer Finder
#WebMethodImage -> WebMethodImage class
Cache: Set
array: Array
1: WebMethodImage
site: AIDASite
systemServices: Dictionary
#URLResolver -> URLResolver
allWebPages: IdentityDictionary
array: Array
52: Association
key: PatientData

Is there a cache that I need to clear or something?

I need to clean up the objects because I have class side code that interacts with it's instances, and these old instances contain obsolete objects!  I have "fixed" them by hand to keep working, but I would like to know how to properly release Aida application domain objects...

Thanks,

Rob

_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Cleaning up old domain objects

Janko Mivšek
Rob Rothwell wrote:
> I seem to have old versions of my domain object (PatientData) that Aida
> seems to be holding on to so I can't garbageCollect them.  I have done
> SwazooAida stop and garbageCollected, but the PointerFinder tool still
> finds that they exist as illustrated below:

Domain object are registered in three places:

1. WebSession instvar #appsForObjects, which maintains a dictionary of
app for every domain object. Not that there is usually many sessions
having this mapping for the same domain object.
2. App instvar #observee, pointing directly to domain object
3. UrlResolver

So, if you want to get rid of domain object, you need to remove it from
  sessions and Url resolver. I'm usually clearing all apps in sessions
every night by:

   WebSessionManager allInstances do: [:each | each removeGuestSessions].
   WebSession allInstances do: [:each | each initAppsForObjects].

First one is in our case not necessary but recommended while second is
specially recommended. Note that with this you kind of "timeout" user's
presentation states too. Also you release quite some memory.

But your domain object will still stay registered on UrlResolver. You
need to manually remove it:

        (AIDASite named: 'yoursite') urlResolver removeObject: myObject

Hope this helps

Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida
Reply | Threaded
Open this post in threaded view
|

Re: Cleaning up old domain objects

Rob Rothwell
Thanks...I never would have "found" this!

I'll try it out...

Rob

On Sun, May 25, 2008 at 4:49 PM, Janko Mivšek <[hidden email]> wrote:
Rob Rothwell wrote:
I seem to have old versions of my domain object (PatientData) that Aida seems to be holding on to so I can't garbageCollect them.  I have done SwazooAida stop and garbageCollected, but the PointerFinder tool still finds that they exist as illustrated below:

Domain object are registered in three places:

1. WebSession instvar #appsForObjects, which maintains a dictionary of app for every domain object. Not that there is usually many sessions having this mapping for the same domain object.
2. App instvar #observee, pointing directly to domain object
3. UrlResolver

So, if you want to get rid of domain object, you need to remove it from  sessions and Url resolver. I'm usually clearing all apps in sessions every night by:

 WebSessionManager allInstances do: [:each | each removeGuestSessions].
 WebSession allInstances do: [:each | each initAppsForObjects].

First one is in our case not necessary but recommended while second is specially recommended. Note that with this you kind of "timeout" user's presentation states too. Also you release quite some memory.

But your domain object will still stay registered on UrlResolver. You need to manually remove it:

       (AIDASite named: 'yoursite') urlResolver removeObject: myObject

Hope this helps

Janko


--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si


_______________________________________________
Aida mailing list
[hidden email]
http://lists.aidaweb.si/mailman/listinfo/aida