cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud Garcia <arn...@imagemed-87.com>
Subject Re: Wicket Cayenne
Date Sat, 24 Apr 2010 12:36:18 GMT
... OK, putting the dataContext in the session object is certainly a good
idea, but for the creation of the DataContext do you think we have to use
the createDataContext() or using the DataContext.getThreadObjectContext()
since it is supposed to be attached to the current thread by the cayenne
filter ...

Arnaud

2010/4/24 Nishant Neeraj <nishant.has.a.question@gmail.com>

> Hi Arnaud,
>
> I have used session to store my dataContext
>
> something like this
>
> public DataContext getSessionDataContext(){
>        synchronized(this){
>            if(this.dataContext==null){
>                this.dataContext = DataContext.createDataContext();
>            }
>        }
>        return this.dataContext;
>    }
>
>
> anywhere I need this, I perform this
>
> DataContext dctx = ((MyAppSession)getSession()).getSessionDataContext();
>
> I think it may not solve the serialization issue, if session objects are
> serialized. But you avoid creating DataContext at every page.
>
> Not sure if this helps you.
>
> You may want to see how DataBinder[1] has implemented it.
>
> [1] http://databinder.net/wicket/show/overview/
>
> - Nishant
>
> On Sat, Apr 24, 2010 at 1:55 PM, Arnaud Garcia <arnaud@imagemed-87.com
> >wrote:
>
> > Hello,
> >
> > I put my question in both forum, (wicket and this one)
> >
> > Does anyone knows how to set up Cayenne for wicket ?
> >
> > In my WicketPage I have :
> >  private DataContext ctxt = (DataContext)
> > DataContext.getThreadObjectContext();
> >
> > but, I don't think it is the good way, since I suppose wicket will
> > serialized the full DataContext... (maybe I can put the
> > getThreadObjectContext() in a method or constructor to avoid the
> > serialization...)
> > -> Well, I don't know how what is the good way  ;-)
> >
> >
> >
> > thanks,
> >
> > Arnaud
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message