This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have a requirement to execute a procedure from a java application. This procedure would take 20-30 minutes to execute. My application will stops till my procedure gets executed.
I don't my application to wait for my procedure to cpomplete its execution.
Is there any way/logic using which I can make this happen. I don't want to use threads for the above mentioned.
~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
You could make it asynchronous via JMS. That is if your business needs can handle it. That being said, unless your procudure is doing admin-type tasks (archiving a bunch of data, report building etc. ) then I reckon it might be doing more then it should - since 20-30 mins. is an awful long time for a procedure to run.
You can also do an Observer/Observable model with your stored proc call in a separate thread which is an observable and the main app as an observer. When the proc is complete, you can use "notify" to tell the Observer that the thread is done.
Never resign to your fate
Joined: Nov 30, 2004
Oops didn't see the "I don't want to use threads" part.