• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

How can I know when a stored procedure finishes execution?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone!

I've got an Oracle stored procedure which I am calling from a Java applet. This procedure takes more than 20 mins to finish and returns no results.
Is there any way to know when the procedure ends? (Prefferably without having to alter the procedure's code).

The procedure does a lot of delete/update/insert queries to several tables.
Up until now I have tried this:



but with no effect.

Please share any ideas if any...!
 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I believe that execute blocks. More logging statements would certainly help you.

Kai
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Correct me if I'm wrong, but
I believe thatwaits until the statement is executed.

If your procedure takes 20 minutes, your code would stop at this line 4 for 20minutes.
If your execute() would have returned a rs, you would now immediately after executing line 4.
If execute() returned null, rs will stay null.
No piece of code you have put below line 4 will change rs.

Regards, Jan


 
Jan Cumps
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and welcome to JavaRanch!
 
Beth Lampard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you everyone for your replies and welcomes


Correct me if I'm wrong, but I believe that

waits until the statement is executed.



It does, that's the main reason the statement execution is in a thread.
I was under the impression that rs becomes true when the stored procedure ends execution.
It doesn't though. In my case it returns false but it will do!

I believe that execute blocks. More logging statements would certainly help you.



True! I could use logging statements and check these to see when the stored procedure ends but it costs a lot!
If we assume that the logs are a table I would have to every so often run a query there to check if the procedure ended.
Doesn't sound like the best solution to me.


Thank you for your help both!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic