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

getThreadObjectContext with domain parameter - code -

2009-09-11 Thread Arnaud Garcia
Hello, I created a filter to use multi domains in a webapp, but I still have a problem, I don't find the bug... if someone can help me to fix it ! (I think that some people will also need this kind of filter, so this is why I post the complete code) So, the last bug is that sometimes the Obj