RE: Scheduled DB clean up service with Struts2

2008-04-11 Thread Frank Fischer
I would have thought of implementing the clean up service as servlet filter outside struts. Or doing the same within an interceptor. Are there any dependencies that would need the clean up service to be bound to a session context? - Frank -Original Message- From: [EMAIL PROTECTED]

RE: Scheduled DB clean up service with Struts2

2008-04-11 Thread Brad A Cupit
the @Resource annotation is included in Java SE 6. If you can't move to Java 6 and have to use Java 5, the annotation can be found in common-annotations.jar (note that a Java EE 5 app can still run in the Java SE 6 JRE) as per the DB clean up service, if you're using Spring for DI you could

Re: Scheduled DB clean up service with Struts2

2008-04-11 Thread Gabriel Belingueres
I've been doing periodic tasks in my web app: I'm using Spring and setting a periodic task to execute is kind of straightforward, but has nothing to do with Struts 2. 2008/4/11, Peter Theissen [EMAIL PROTECTED]: Hello, I now searched a while to get an idea how to implement a DB clean up

Re: Scheduled DB clean up service with Struts2

2008-04-11 Thread Gabriel Belingueres
I doubt that this filter/interceptor approach to executing a task periodically would be a good idea: What if it is take too long? What happens to the current user request? What if it just time out? Typical periodic clean up tasks are better performed when nobody is using the system (or at least

Re: Scheduled DB clean up service with Struts2

2008-04-11 Thread Peter Theissen
No, no dependencies at all. It should just do the cleanup every day. However, I would like to use my certain action methods, since they already contain all the funtionalities for DB acces. Thanks Peter I would have thought of implementing the clean up service as servlet filter outside struts.

RE: Scheduled DB clean up service with Struts2

2008-04-11 Thread Frank Fischer
Sorry, of course i meant servlet context listener, not servlet filter However, I would like to use my certain action methods, since they already contain all the funtionalities for DB acces. Then i guess it would be a smart way by letting spring inject the DBA object into your action(s)

RE: Scheduled DB clean up service with Struts2

2008-04-11 Thread Frank Fischer
I doubt that this filter/interceptor approach to executing a task periodically would be a good idea: What if it is take too long? What happens to the current user request? What if it just time out? Agree, you're right (btw, i meant context listener when i wrote filter - sorry). But still

Re: Scheduled DB clean up service with Struts2

2008-04-11 Thread Gabriel Belingueres
Then I guess it would be a good excercice to refactor that database access code into a DAO to decouple your actions from the DB. 2008/4/11, Peter Theissen [EMAIL PROTECTED]: No, no dependencies at all. It should just do the cleanup every day. However, I would like to use my certain action