cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: child contexts in a webapp with cayenne 3.2
Date Tue, 14 Jan 2014 12:07:47 GMT
How you access various app services depends on your app. If you are using injection, it is
declarative and fairly trivial. If not, you can either use a static singleton, or look things
up in ServletContext. E.g. if you are using CayenneFilter to bootstrap Cayenne, you’d do
this:

ServletContext servletContext = .. 
CayenneRuntime r = WebUtil.getCayenneRuntime(servletContext);

Andrus


On Jan 14, 2014, at 12:43 PM, jotpe <jotpe.osm@gmail.com> wrote:
> Hello,
> 
> how can I create a child context in 3.2?
> 
> class ObjectContext in 3.0 the method createChildContext is deprecated and
> CayenneRuntime.getContext(DataChannel) should be used.
> 
> How can I receive the CayenneRuntime object in my webapplication, where no
> ServerRuntime instance is available directly?
> 
> Regards Johannes


Mime
View raw message