1

we are dealing with big data sets which take minutes to execute the stored procedures in the back end ( say 20 minutes). how to model services to handle these kind of scenarios.

  • Synchronous services are ruled out as it will timeout
  • Batch processing is ruled out as it will hamper user experience

Is there any framework in java stack to handle this.

tourist
  • 4,165
  • 6
  • 25
  • 47
  • "hamper user experience", but it takes 20 mins? You're having a laugh. You HAVE to use batch processing. A 20 min wait _IS_ a hampered user experience. – Stewart Oct 13 '15 at 07:38

1 Answers1

2

You can use the Executor Framework.

It allows multiple threads to be started and waited for, while you can continue doing other stuff.

You can create a connection in a Runnable and just maintain that connection until you are done.

Combine it with network timeouts.

Community
  • 1
  • 1
Rob Audenaerde
  • 19,195
  • 10
  • 76
  • 121
  • there is nothing do after invoking, we just need to invoke stored procedure and wait idle for response . – tourist Oct 13 '15 at 07:32
  • Then what is the problem? If you just want to prevent time-outs on your connections, increase the time-out settings. See for example here: http://stackoverflow.com/q/18822552/461499 – Rob Audenaerde Oct 13 '15 at 07:34