You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Markus Reich <ma...@markusreich.at> on 2013/08/06 15:35:18 UTC

Version 3.2 - createChildContext()

Hi,

I'm currently switching to 3.2 version. I now got a problem with
ObjectContext.createChildContext() as mentioned in the API docu, you should
use instead CayenneRuntime.getContext(DataChannel)
http://cayenne.apache.org/docs/3.1/api/org/apache/cayenne/ObjectContext.html
But I'm not sure how to get in my webapp the Runtime instance?

best regards
Meex

Re: Version 3.2 - createChildContext()

Posted by Markus Reich <ma...@markusreich.at>.
perfect and fast answer as usual, thx Meex


2013/8/6 Andrus Adamchik <an...@objectstyle.org>

> The answer depends on how you are getting a hold of ObjectContext (i.e.
> how Cayenne is bootstrapped). If you are using CayenneFilter, you can do
> this:
>
> import org.apache.cayenne.configuration.web.WebUtil;
> ...
> CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);
>
> Andrus
>
> On Aug 6, 2013, at 4:35 PM, Markus Reich <ma...@markusreich.at>
> wrote:
> > Hi,
> >
> > I'm currently switching to 3.2 version. I now got a problem with
> > ObjectContext.createChildContext() as mentioned in the API docu, you
> should
> > use instead CayenneRuntime.getContext(DataChannel)
> >
> http://cayenne.apache.org/docs/3.1/api/org/apache/cayenne/ObjectContext.html
> > But I'm not sure how to get in my webapp the Runtime instance?
> >
> > best regards
> > Meex
>
>


-- 
*Markus Reich*
Moosbach 28/2
6392 St. Jakob i.H.
www.markusreich.at / www.meeximum.at
markus.reich@markusreich.at

Re: Version 3.2 - createChildContext()

Posted by Andrus Adamchik <an...@objectstyle.org>.
The answer depends on how you are getting a hold of ObjectContext (i.e. how Cayenne is bootstrapped). If you are using CayenneFilter, you can do this:

import org.apache.cayenne.configuration.web.WebUtil;
...
CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);

Andrus

On Aug 6, 2013, at 4:35 PM, Markus Reich <ma...@markusreich.at> wrote:
> Hi,
> 
> I'm currently switching to 3.2 version. I now got a problem with
> ObjectContext.createChildContext() as mentioned in the API docu, you should
> use instead CayenneRuntime.getContext(DataChannel)
> http://cayenne.apache.org/docs/3.1/api/org/apache/cayenne/ObjectContext.html
> But I'm not sure how to get in my webapp the Runtime instance?
> 
> best regards
> Meex