Best Way to get a DataContext (in this case)

From: Gary Jarrel (garyjarre..mail.com)
Date: Fri Jan 19 2007 - 22:24:15 EST

  • Next message: Jun Bondoy: "help on relationship"

    Hi All!

    I've got a web app using struts, spring and cayenne. I use a web
    application listener to setup the thread bound data context for any
    given actions. All database access is abstracted away via a number of
    DAOs. For any given action (all managed by spring) the required DAOs
    are injected and are able to access the data context as it has been
    bound to the thread. All works very well.

    Now we've created a number of objects which collect various stats on
    the data in the DB. These are executed at various time intervals and
    are managed by Spring and the Quartz API. My question is what is the
    best practice in providing a data context for these types of objects.
    Can't use a listener as no Action is being executed - Spring simply
    instantiates the object and executes the specified method. Should I
    perhaps go the way described in the Cayenne/Spring example? Seems as
    though there is a fair bit of implementation for just a few objects.

    Any suggestions would be much appreciated!

    Thank you!

    - garyj



    This archive was generated by hypermail 2.0.0 : Fri Jan 19 2007 - 22:24:52 EST