You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Kevin Menard <ni...@gmail.com> on 2008/08/14 01:57:55 UTC

CayenneContext bound to ThreadLocal?

Hi,
Does anyone know why there's no utility method to bind a CayenneContext to
ThreadLocal like there is for DataContext?  Was it because it just wasn't
needed or is there something funky to watch out for?  If there's no good
reason not to have it, does anyone object to me adding it or creating an
ObjectContextUtils class for making it simple?

-- 
Thanks,
Kevin

Re: CayenneContext bound to ThreadLocal?

Posted by Kevin Menard <ni...@gmail.com>.
That sounds like a reasonable approach to me.  I'll open up a JIRA and try
to look at it this weekend.
-- 
Kevin


On Thu, Aug 14, 2008 at 2:35 AM, Andrus Adamchik <an...@objectstyle.org>wrote:

> It's never been implemented cause I couldn't figure out a good place to put
> it.
>
> Now looking at the current Cayenne context structure, maybe instead of
> ObjectContextUtils, we should use BaseContext class to store a static
> ThreadLocal? And then deprecate corresponding DataContext methods, pointing
> them to a superclass static var?
>
> Andrus
>
>
>
> On Aug 14, 2008, at 2:57 AM, Kevin Menard wrote:
>
>> Hi,
>> Does anyone know why there's no utility method to bind a CayenneContext to
>> ThreadLocal like there is for DataContext?  Was it because it just wasn't
>> needed or is there something funky to watch out for?  If there's no good
>> reason not to have it, does anyone object to me adding it or creating an
>> ObjectContextUtils class for making it simple?
>>
>> --
>> Thanks,
>> Kevin
>>
>
>

Re: CayenneContext bound to ThreadLocal?

Posted by Andrus Adamchik <an...@objectstyle.org>.
It's never been implemented cause I couldn't figure out a good place  
to put it.

Now looking at the current Cayenne context structure, maybe instead of  
ObjectContextUtils, we should use BaseContext class to store a static  
ThreadLocal? And then deprecate corresponding DataContext methods,  
pointing them to a superclass static var?

Andrus


On Aug 14, 2008, at 2:57 AM, Kevin Menard wrote:
> Hi,
> Does anyone know why there's no utility method to bind a  
> CayenneContext to
> ThreadLocal like there is for DataContext?  Was it because it just  
> wasn't
> needed or is there something funky to watch out for?  If there's no  
> good
> reason not to have it, does anyone object to me adding it or  
> creating an
> ObjectContextUtils class for making it simple?
>
> -- 
> Thanks,
> Kevin