I am writing a Spring application where I need to trigger an external job and wait till the job finishes (which updates a field in an Oracle table) - I am thinking of polling the table till its updated. Could anyone suggest a method of doing that in Java? Thanks
Asked
Active
Viewed 178 times
0
-
Why don't you hook it with oracle trigger? – Ruelos Joel Jun 28 '16 at 03:18
-
What does *"trigger an external job"* mean? – Andreas Jun 28 '16 at 03:27
-
@Andreas its a call to a Java EE servlet - e.g. http://example.com/app/JobServlet?Action=START&BatchId=123 – user2666282 Jun 28 '16 at 13:41
1 Answers
1
Shell script
Create a shell script, run for external job in a separate thread,let it return a proper exit code, based on the exit code received from shell, execute your dependent process
Messaging
Let the external job to notify once it's done, on receiving the trigger/event you can start the other process waiting for this to be done.

Saravana
- 12,647
- 2
- 39
- 57
-
-
-
It doesn't - its called via a url - the only way to know is when the db field is updated. – user2666282 Jun 28 '16 at 15:04
-
have a look at http://stackoverflow.com/questions/12618915/how-to-implement-a-db-listener-in-java – Saravana Jun 28 '16 at 16:38
-
thanks but I don't want a listener - I want to pause and poll and proceed only once the field has been updated – user2666282 Jun 28 '16 at 17:09