RE: Question about DataContext

From: Fredrik Liden (flide..ranslate.com)
Date: Tue May 10 2005 - 14:33:16 EDT

  • Next message: Cris Daniluk: "Re: Question about DataContext"

    That's what I was assuming too.
     
    However, let's say I made a change to the db outside of Cayenne.
    Now, even though I log out and invalidate the session when I log back in
    again I still get the old values.
    It's like the context isn't destroyed with that particular http session.
    If I log in from another machine I'll get the latest data.
     
    I'll doublecheck it again,
     
    Thanks!
     
    Fredrik
     
     
     
    -----Original Message-----
    From: Joshua Pyle [mailto:joshua.t.pyl..mail.com]
    Sent: Tuesday, May 10, 2005 11:13 AM
    To: cayenne-use..bjectstyle.org
    Subject: Re: Question about DataContext

            I believe that is exactly what is being done :-)
             
            My understanding is that if the session attribute does not exist
    this call will put it there.
             
            Joshua T. Pyle
            
             
            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) ?
                    
                    Fredrik
                    
                    

            --
            Joshua T. Pyle
            Go has always existed.



    This archive was generated by hypermail 2.0.0 : Tue May 10 2005 - 14:31:24 EDT