Disposing DataContext

From: Howard Treisman (htreisma..voka.com)
Date: Sat Dec 17 2005 - 00:20:40 EST

  • Next message: Joshua Pyle: "Re: Disposing DataContext"

    Hi
    I'm writing some Cayenne code that exists in a library, and will be
    called by an external program.
     
    1. Is it okay to just instantiate a DataContext each time my method is
    called? In particular, are there any performance implications of doing
    this? I don't have control over thread or session creation, so it's
    difficult for me to set up the DataContext on the thread, etc.
     
    2. When my method completes, do I need to dispose or cleanup the
    DataContext in any way? Can I just create it as a local variable, and
    let garbage collection do its thing? Are there any memory or connection
    leakage issues?
     
    As a side issue - I'm reasonably sure these questions have been answered
    previously on the mailing list - is there any better way of searching
    the archieves than simply clicking on each month in turn?
     
    Many thanks,
    Howard
     
    ________________________________

     

    Howard Treisman
    Technical Director
    Tel:+61 2 9976 4500
    Fax: +61 2 9976 5055
    Mobile: 0413 007 206
    Web: www.avoka.com <blocked::http://www.avoka.com>
    Email: htreisma..voka.com <blocked::mailto:htreisman@avoka.com>
    International: + 612 9976 4500 Current time
    <blocked::http://www.worldtimeserver.com/current_time_in_AU-NSW.aspx>
    Instant Messaging: MSN:howardtreisma..otmail.com Yahoo: htreisman
    AOL:howardtreisman

     



    avoka_logo_25pt_blue.gif



    This archive was generated by hypermail 2.0.0 : Sat Dec 17 2005 - 00:20:43 EST