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&qu
es 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
> ("Se
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
sh, 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
seContext {
>
>protected static final ThreadLocal>
> threadObjectContext = new ThreadLocal>();
>
>public static ObjectContext getThreadObjectContext(String domain)
> throws IllegalStateException {
> ...
> public static void bindThreadObjectContext(ObjectContext context,
&g
ObjectContext = new ThreadLocal>();
public static ObjectContext getThreadObjectContext(String domain)
throws IllegalStateException {
...
public static void bindThreadObjectContext(ObjectContext context,
String domain) {
Map objectContextMap =
Collections.synchronize
threadObjectContext = new ThreadLocal>();
>
>public static ObjectContext getThreadObjectContext(String domain)
> throws IllegalStateException {
> ObjectContext context = threadObjectContext.get().get(domain);
> if (context == null) {
>throw new Ill
static final ThreadLocal>
threadObjectContext = new ThreadLocal>();
public static ObjectContext getThreadObjectContext(String domain)
throws IllegalStateException {
ObjectContext context = threadObjectContext.get().get(domain);
if (context == null) {
thr
in.getName());
>}
>}
> }
>
> -- ImagemedBaseContext ----
> package com.imagemed.cayenne;
>
> import java.util.Collections;
> import java.util.HashMap;
> import java.util.Map;
> import java.util.logging.
tLogger(ImagemedBaseContext.class.getName());
public static ObjectContext getThreadObjectContext(String domain)
throws IllegalStateException {
ThreadLocal threadObjectContext =
threadLocalMap.get(domain);
ObjectContext context = threadObjectContext.get();
if (context == nu
10 matches
Mail list logo