• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Invoke two stored proceedures parlally

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My application flow like below.

jsp->Controller->Action->ModuleSLEJB->SubModuleSLEJB->DAO>>oracleDB


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..

Please share your valuble inputs/suggestions ...

Thanks in advance.
Anantha

 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anantha Reddy wrote:what are the pros and cons what could be the best solution for the requirement..



Are you asking w.r.t performance or in general? If this is not something specific to performance then i can move it to a more appropriate forum for you, where you can get better answers.
 
Anantha Reddy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah!.. it is not releted to performence, it is bit complex and general requirement
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Anantha Reddy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic