• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets and PL\SQL

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • 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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic