cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <>
Subject Re: getThreadObjectContext
Date Fri, 19 Nov 2010 22:09:48 GMT
Hi Marek,

I assume you are talking about using
BaseContex.getThreadObjectContext() along with the
WebApplicationContextFilter described here:

The scope of those ObjectContexts are indeed session-based for the web
application.  Each user gets a unique one, but the same ObjectContext
is re-attached each request/response cycle for the user, so
objects/etc in the ObjectContext stay around across requests.


On Fri, Nov 19, 2010 at 2:52 PM, Marek Šabo <> wrote:
> Hi all,
> just wanted to ask you how scoped ObjectContext does method
> getThreadObjectContext() return?
> I mean javadoc says it's bound to current thread, and there is a new thread
> started during each request so is it "RequestScoped"? Or is it a global
> object that gets bound to the thread when new request arrives
> ("SessionScoped")?
> Friend of mine told me that he was only using this method for obtaining OC
> and that it remembered fk dependency issues between independent request so
> I'd go for "SessionScoped".
> Regards,
> --
> Marek Šabo

View raw message