cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Jarrel" <garyjar...@gmail.com>
Subject Best Way to get a DataContext (in this case)
Date Sat, 20 Jan 2007 03:24:15 GMT
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

Mime
View raw message