• 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

Servlets and PL\SQL

 
Ranch Hand
Posts: 430
Android VI Editor Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I've got the following code that calls a stored procedure from a web based servlet application.



The above statement calls a PL\SQL stored procedure in the database. The stored procedure takes about 2 hrs to complete.

When my servlet calls this procedure, the relevant webpage on the front end is showing that its waiting for the stored procedure to return something.

How can i call the stored procedure and have it run in the background while the servlet returns e.g. a message saying that the stored procedure is running in the background.

I just need an idea or references as to how i can do this. Does the servlet have to call the PL\SQL in another thread? Is there something in CallableStatement that i can use to tell the servlet not to wait for a response from the PL\sqL?


Thanks
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it takes 2 hours, I would make the call in a new thread and email the user when it's done.

If you want simple example of a webapp that starts a long running process in a new thread see:
http://simple.souther.us/not-so-simple.html
Look for LongRunningProcess.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic