Re: Question about DataContext

From: Cris Daniluk (cris.danilu..mail.com)
Date: Tue May 10 2005 - 14:19:30 EDT

  • Next message: Mike Kienenberger: "Re: Question about DataContext"

    > On 5/10/05, Fredrik Liden <flide..ranslate.com> wrote:
    > > I'm just curious,
    > > Is there any preference over calling the following line for every
    > > request to various JSPs and Servlets compared to just calling it once
    > > during login and then take that context and store it as a session
    > > attribute?
    > >
    > > DataContext context =
    > >
    > BasicServletConfiguration.getDefaultContext(request.getSession());
    > >
    > > The reason I ask is that sometimes I need to clear out the context and
    > > all the objects (say if a change was made to the underlying db). I'm
    > > thinking the logout which invalidates the session would be a good place
    > > for that. Or during the logout, should I just release all the objects in
    > > the dataContext (if that's possible) ?

    What Josh said is true. The DataContext IS being stored in the session
    for you. It IS destroyed on logout.

    Keep doin what you're doin... No sense in storing a reference to a
    DataContext in the session, in the session :)



    This archive was generated by hypermail 2.0.0 : Tue May 10 2005 - 14:19:32 EDT