My requirement is when I submit Jsp with some action , action class calls some business metod of ModuleSLEJB which inturn calles the bussiness method of SubModuleSLEJB which in turn call the actuval implementation method in corresponding DAO class.
what method supposed to do?
It invokes 2 stored procedures with some in params. each procedure takes 10-12 mins to complete its process, once done send mail to user.
> I have to invoke 2 procs paralally within 10 or 12 mins both will complete process.
> upon submit of jsp those 2 procs should get triggered with some in params, control has to return to jsp to show some message like 'procs are invoked you will get report by mail with in 10-15 mins' irrespective of proc state(finished/running state), should not wait till pros coplete execution.
can any one suggest how can I achive that... do i have to use MDBs for that, or do I need to invoke 2 seperate threads?..(using multi threading concept)... what are the pros and cons what could be the best solution for the requirement..
Just as a general comment, I've learned the hard way that stored procedures should only be used as a last resort. However, this sounds like it's probably one of them.
It appears that you're asking specifically about how to get this to work in a web application, where fast turnaround is important. While MDB's can be used to kick off long-running processes, probably they're not appropriate here. So most likely you want to run threads.
Running threads in a web application have certain rules and constraints, which I won't go into here (search the servlets and JSF forums for "null servlet" and/or "engine" and you should find some detailed discussions).
An IDE is no substitute for an Intelligent Developer.
Joined: Jun 24, 2008
Hey thanks for reply..
Yeah! we have implemented the requirement like below.
now we are calling one stored proc whic is a wrapper proc which does submit 2 jobs with 2 procs and return control immediatly irrespective of those 2 job states, and we will be able to show some message to used upon submission of form.
I would appriciate if you can share any idea of implementing the same using java with less turn around time, w.rt invoking/ calling 2 stored procs parlally on submission of form.