• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Thread programming in a Struts application

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi... Can we use Java Threads in a struts web application as we do in a stand Alone application. As all the control would be under Web/Application Server , it is efficient/allowable to induce threads in a struts web application . Please Suggest.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which struts version you were using?
What do you want to do with threads / why do you need it actually?
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spawning threads is discouraged because it is safer to allow the container to manage threads. Have a look at this discussion for some alternatives.
 
Roger Jam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Mohan and Joe..thanks for your suggestions. Sorry i was not able to get back here after posting. My requirement was to send a request to data base after some update is done depending on a condition.Client wants this to be independent. He wants to proceed to other links without depending on this operation result or time . I thought of using threads,but i didnt get any assured/suitable information whether i can use threads or any other alternatives. My application is struts based and we are using JBOSS server.Please suggest.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One strategy I've used is to use a JMS queue to communicate with a stand-alone process. The request just has to place all the required information on the queue. The JMS queue is useful because it can queue up requests should the stand-alone process fail at any time. The stand-alone process reads from the queue, executes whatever processing it has to do then it sends an email with the report as an attachment.
 
reply
    Bookmark Topic Watch Topic
  • New Topic