I did stress test by sending out 80 requests simultanously, therefore 80 tasks were created and submitted, and results are realized when they become available. Its amazing that the code work just fine. I was actually impressed by the API.
Future<Result> resp = executorService.submit(task); Result r = resp.get(); // code sending results back to client
blocks untill all results are back, but I want to periodically return the results from the stored proc, say, first 1000 rows are fetched and sent back, and another 1000.
Result r = resp.get();