• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running java class in background

 
Daniel Andersson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I've created a java class which uses an url connection to retrieve html table data from an external webb site and save it in a temporary sql table in mysql.

The external webb site has regular performance problems and therefor my own site has the same problems.

Is there a way to execute this class in the background whith some kind of "nowait" so I can proceed with the page?
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I figured it out but I think it is a threading issue. I will wait for the masters to weigh in on this before providing my ideas on the design.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an example on my site http://simple.souther.us/not-so-simple.html
called LongRunningProcess that does this.
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may create a daemon thread, how ever starting threads within servlet container is not always good, You may use asynchronous (non blocking) IO also.

You may want to look at Jakarta Http Client also
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!