title: Using CommonJ WorkManagerTaskExecutor Spring 3 for multithreading
body: <p>Hello everyone I am new to the forum and I just had a question about working with Spring's commonj WorkManagerTaskExecutor.  I have been on a bunch of forums looking for better information on the subject but I haven't seen anything detailed on the subject.  So here is my situation.</p>
  
  <p>My application uses multiple threads which were being handled by ThreadPoolTaskExecutor which a friend told me he thought would not be the correct choice since we are using websphere 7.0 application server.  I had everything working correctly and with some minor tweaking was able to replace the ThreadPoolTaskExecutor with a WorkManagerTaskExecutor.  When I run the application the threads fire off via the default work manager on the websphere server.  The problem that seems to be happening though is that even though I am using the workManagerTaskExecutor.waitForAll(collection,timeout); It never actually waits for the threads to complete.  I know that it is working that is the threads are executing their respective methods because if you issue a lengthy for loop after all of this the data is there where as if you do not the data is not there.  I was wondering the following two things.</p>
  
  <ol>
  <li><p>Is the WorkManagerTaskExecutor the way to go?  Or would using a ThreadPoolTaskExecutor be sufficient for handling multiple threads on a enterprise web application?</p></li>
  <li><p>If the WorkManagerTaskExecutor is the way to go?  Any ideas as to why the waitForAll method is completing as if the methods are done?  When clearly they are not?  After the page loads I can see in the logging that the methods are still running and eventually completeing.</p></li>
  </ol>
  
  <p>Any help would be much appreciated.  If I left anything out I will gladly try and give more information about the issue as I truly appreciate any help that might be given.</p>
  
  <p>Thanks in Advance,</p>
  
  <p>Bill</p>