There might be some debate about this, but a daemon thread would be my suggestion.

I know the rule about no spawning threads in a servlet container, but I've always 
thought that rule was a bit nebulous... Does it literally mean don't spwan any 
threads, or does it mean don't spawn any threads to service requests?  I think the 
former is correct... A daemon thread isn't attached to any given request, so I don't 
see where there is a problem.

Practically speaking, I do this in a major app here at work, running under Tomcat as 
well as Websphere, with no ill effect.  If your app is architected in such a way that 
the code you need to execute on a schedule is not part of the Actions (which chances 
are it shouldn't be), then your all set: just have the daemon thread instantiate 
whatever it needs and do what you need.  If you really need to execute the Action, you 
can use standard net code to go ahead and execute an appropriately-constructing 
request.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Fri, October 1, 2004 8:49 am, Ciaran Hanley said:
> Hi,
> 
> 
> 
> I have several actions in my struts webapp that require a user to manually
> click a form button to carry out the action, e.g. update database. I want
> to
> be able to schedule these actions to be carried out at a set time daily
> without any user intervention. I am looking for suggestions on what ways
> that this can be accomplished?
> 
> 
> 
> Thanks,
> 
> Ciaran
> 
>   _____
> 
> 
> Ciaran Hanley
> 
> Software Development
> 
> Sentenial Ltd.
> 
> Tel: 00 353 (1) 629 2141
> Fax: 00 353 (1) 629 2147
> 
> Mob: 00 353 (0) 87 916 4943
> E-Mail: [EMAIL PROTECTED]
> 
> Web: www.sentenial.ie <http://www.sentenial.ie/>
> 
> 
> 
>   _____
> 
> Notice:
> 
> The information in this e-mail is intended only for the named recipient
> and
> may be privileged or confidential. If you are not the intended recipient,
> please notify us immediately and do not copy, distribute or take any
> action
> based on this e-mail. Sentenial Ltd will not be liable for direct,
> special,
> indirect or consequential loss as a result of any virus being passed on or
> arising from alteration of the contents of this e-mail by a third party.
> All
> e-mail sent to or from this address is subject to archive and review by
> someone other than the intended recipient. Any opinions expressed in this
> e-mail are those of the individual and not necessarily those of Sentenial
> Ltd. All Personal Data acquired by Sentenial Ltd for which the Data
> Protection Act 1998 ("the Act") applies shall be stored and processed in
> accordance with the Act. Should you wish to check, amend or remove the
> details of your Personal Data held by Sentenial Ltd, please contact us at
> <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to