Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I know when a stored procedure finishes execution?

 
Beth Lampard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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...!
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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

Kai
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and welcome to JavaRanch!
 
Beth Lampard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic