Re: getThreadObjectContext

2010-11-19 Thread Marek Šabo
Hi, thanks, that was exactly what I wanted to hear. Regards, -- Marek Šabo On 11/19/2010 11:09 PM, Michael Gentry wrote: Hi Marek, I assume you are talking about using BaseContex.getThreadObjectContext() along with the WebApplicationContextFilter described here: http://cayenne.apache.org/d

Re: getThreadObjectContext

2010-11-19 Thread Michael Gentry
Hi Marek, I assume you are talking about using BaseContex.getThreadObjectContext() along with the WebApplicationContextFilter described here: http://cayenne.apache.org/doc30/web-applications.html The scope of those ObjectContexts are indeed session-based for the web application. Each user gets

Re: getThreadObjectContext with domain parameter - code -

2009-09-15 Thread Arnaud Garcia
;-) many thanks it works well now. Arnaud 2009/9/14 Andrey Razumovsky : > Now you're creating new HashMap every request, and, as in your first > example, old bindings get erased. Bind method should be rewritten as > > public static void bindThreadObjectContext(ObjectContext context, > String doma

Re: getThreadObjectContext with domain parameter - code -

2009-09-14 Thread Andrey Razumovsky
Now you're creating new HashMap every request, and, as in your first example, old bindings get erased. Bind method should be rewritten as public static void bindThreadObjectContext(ObjectContext context, String domain) { Map objectContextMap = threadObjectContext.get(); if (objectCo

Re: getThreadObjectContext with domain parameter - code -

2009-09-14 Thread Arnaud Garcia
Well, I think there is something I don't understand, I change again and, no change.. now I build a new hash, that I put on the ThreadLocal I am sorry but I don't understand why... Arnaud code below public class ImagemedBaseContext { protected static final ThreadLocal> threadObjectContext =

Re: getThreadObjectContext with domain parameter - code -

2009-09-14 Thread Andrey Razumovsky
Now objectContextMap is static, so only one context is allowed per domain name (for entire app). Map should be created on the fly if needed, in bind() 2009/9/14 Arnaud Garcia > OK, so I just change by adding new ObjectContext to a Map and set/get > this Map from the ThreadLocal which is only as

Re: getThreadObjectContext with domain parameter - code -

2009-09-14 Thread Arnaud Garcia
OK, so I just change by adding new ObjectContext to a Map and set/get this Map from the ThreadLocal which is only as the map created one time... But, I still have the same error sometimes below the new code if you can have a quick look... many thanks, for help ! arnaud --

Re: getThreadObjectContext with domain parameter - code -

2009-09-11 Thread Andrey Razumovsky
Well, looking at your code, I think you should not create new ThreadLocal each time request is received (in bindThreadObjectContext). You old bindings just get erased 2009/9/11 Arnaud Garcia > Hello, > > I created a filter to use multi domains in a webapp, but I still have > a problem, I don