title: How write java batchprocess running from tomcat
body: <p>I'm writing spring web application that is running on TomCat.7 and one of functionality will be a processing data from db using java.concurrency.</p>
  
  <p>I expect that db processing will be a very time dealing because of calculations, and I need high performance for this process.</p>
  
  <p>My question is if it is good idea (or maybe only possibility) to run that thread in TomCat container?</p>
  
  <pre><code>@RequestMapping(value = "run_process", method = RequestMethod.GET)
      public RequestWrapper runProcess(ModelMap model) {
  
          Runnable runCrawler = new Crawler();
          runCrawler.run();
          System.out.println("##run_process!");
  
          return new RequestWrapper();
      }
  </code></pre>
  
  <p>My project structure is like:</p>
  
  <p>-src <br>
    -com.scanner.batchprocess<br>
    -com.scanner.crawler<br>
    -com.scanner.webapp.controllers<br></p>
  
  <p>I don't have any experience in creating programs that are challenging computationally, so I'm afraid that maybe I should create new clean java project with main class that will be called from webapp whenever user run BatchProcess.
  Can be a significant time difference in execution time application from Tomcat than True java application?</p>