Vincent Massol wrote:
Ok I see.
Well, here we don't have the choice so I am going to try to
put in place some mechanism to release resource objects.
ok be very very careful with this. We've been beaten already in the
past by this and it took me several days to find out the problem...
Ok I did it.
I put a filter that cleans things up (i.e., release the component) after
each request. The object is passed to the filter through the request's
attributes.
If the resource throws an unhandled exception then the filter is not
called. However a custom StatusService can catch this exception and
perform the cleanup.
In this way a resource component is instantiated and released at each
request.
Are we storing any state in the resource components?
Normally we don't but Restlet might. I don't know.
-Fabio