How to propoerly close context db connection

From: Colin Bankier (colinbankie..otmail.com)
Date: Mon Mar 31 2008 - 02:58:49 EDT

  • Next message: Andrus Adamchik: "Re: How to propoerly close context db connection"

    Hi,
    I can't seem to find any examples of how to properly close a database
    connection and clear any related cache.

    My app is using an embedded database, of which it can download a new version
    and overwrite the old one.

    At the moment I try to clear any cache using context.getQueryCache().clear()
    (context is my DataContext instance).
     And then set the context to null (for want of anything better to do).

    The app then downloads and copies a new version of the database over the
    old, and connects using context = DataContext.createDataContext() etc etc.

    However - the data displayed STILL is the old data - until the app is
    shutdown and re-started when it correctly reads the new data.

    Any help on how to properly close the database connection would be greatly
    appreciated.
    Cheers,
    Colin Bankier.

    -- 
    View this message in context: http://www.nabble.com/How-to-propoerly-close-context-db-connection-tp16392733p16392733.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
    



    This archive was generated by hypermail 2.0.0 : Mon Mar 31 2008 - 02:59:56 EDT