Re: How do I retrieve a connection ...

From: Mike Kienenberger (mkienen..mail.com)
Date: Fri Mar 03 2006 - 15:21:13 EST

  • Next message: Borut Bolčin: "Re: DbGenerator"

    DataContext dataContext = DataContext.createDataContext();

    On 3/3/06, chad smith <cksuta..otmail.com> wrote:
    > from the Cayenne's connection pool. I need to create a singleton that will
    > do some work on a periodic basis. This bean will be created when the app
    > server (tomcat) starts but won't be tied to any user thread or session. It
    > will wake up (from Thread.sleep)and need to examine/manipulate some data but
    > I'm not quite sure how my DAO will get access to the DataContext because I'm
    > currently using a servlet filter approach to bind Cayenne to ThreadLocal ...
    >
    > DataContext dataContext =
    > ServletUtil.getSessionContext(session);
    > DataContext.bindThreadDataContext(dataContext);
    >
    > I'm sure there is a solution, but my perusal of the API has yet to render a
    > clue.
    >
    > thanks in advance,
    > Chad
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Mar 03 2006 - 15:21:15 EST