> 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 it depends on the job that has to be done and about the database design. Think about a clean up job that takes quite a while and the main web service needs to be suspended meanwhile. Then a Servlet Context Listener could start the db maintenance while an intercepter could catch ever request and send back a 503 during that maintenance window. But of course the main job would then be done from the context listener (or any pojo service that was injected using spring i.e.). - Frank > > Typical periodic clean up tasks are better performed when nobody is > using the system (or at least when the quantity of concurrent users in > the system be at the absolute minimum), but since this is executed > when somebody makes a request to the web app, there is no warranty > that this task be executed at all. > > 2008/4/11, Frank Fischer <[EMAIL PROTECTED]>: > > > > 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] [mailto:[EMAIL PROTECTED] > > > Sent: Friday, April 11, 2008 2:25 PM > > > To: Struts Users Mailing List > > > Subject: Scheduled DB clean up service with Struts2 > > > > > > Hello, > > > > > > I now searched a while to get an idea how to implement > > > a DB clean up service with Struts2. The best link I found > > > was the following one: > > > following > > > http://www.javabeat.net/javabeat/ejb3/articles/timer_services_ > > > api_in_ejb_3_0_2.php > > > > > > What I dont understand is how to get the session context. > > > As described in the link Im using dependency injection: > > > >>> > > > @Resource > > > Private SessionContext s; > > > <<< > > > but unfortunately that doesnt work. Eclipse says that it > > > doesnt know the @Resource annotation. > > > However, the ejb3-persistence.jar is integrated in the > > > libs. Therefore, the annotation should be well known > > > to Eclipse? > > > > > > What I also dont understand that - even when I got that > > > stuff with that timer working - "who" starts the bean the > > > first time? Do I have to reconfigure something? > > > What happens if I restart the server? > > > > > > Another more general question is: > > > is that the most suitable way to implement the > > > DB clean up service, assuing that further services > > > wont be added in the future (otherwise: scheduler as > > > far from what I've read)? > > > > > > Thanks and best regards > > > Peter > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]