On Sun, Apr 15, 2018 at 12:47 PM JK <[email protected]> wrote:

> Hello,
>
> I have a bit of confusion around how Cayenne contex works inside web
> application.
> I dont really need to have session scoped context- however, there is a
> specific need to have isolated scopes .
>
> 1) What is the best way to manage Cayenne context inside a web application
> ? Is creating a new context for every http request a good practice ? any
> known performance degradation ?

You need the runtime (or injector) to create contexts, so you have to get
it from somewhere, either the servletcontext or a static variable. Creating
a context for each request is typical and performs well.


> 2) Is CayenneFilter good enough for this purpose ?

Typically, yes


> 3) My application requires isolated scopes and I do create multiple child
> context ( but only 1 level ). What happens to the child context  . What
> time do they get removed from memory ?or do I need to force release these
> somehow ?
>
They get garbage collected like everything else, there isn't manual
attention needed except managing cache size if you are caching.

>
>

Reply via email to