How to cancell long-runnig actionListener /stored proc. call/
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cvele_Cvele
Posted On:   Wednesday, February 25, 2009 05:24 AM

Hi, We have one actionListener with just one, long-runnig statement (for example, Oracle stored proc call). Now, we want to provide our user with abillity to cancel this actionListener, by clicking to another, 'Cancel' command Button In general, wonder if this possible at all (so, to cancel some Java server side method) and if yes, how to do this , if this method actually a stored proc call ? My idea (for now) is : - To use that actionListener in order to start new Java Thread (which calls stored proc). After that, the same actionListener saves reference to the PreparedStatement (whics executes updates) in order to call PreparedStatement.cancel() on later) AND finishes its works (along with JSF lifecycle), b   More>>

Hi,
We have one actionListener with just one, long-runnig statement (for example, Oracle stored proc call).
Now, we want to provide our user with abillity to cancel this actionListener, by clicking to another, 'Cancel' command Button

In general, wonder if this possible at all (so, to cancel some Java server side method) and if yes, how to do this , if this method actually a stored proc call ?

My idea (for now) is :
- To use that actionListener in order to start new Java Thread (which calls stored proc).
After that, the same actionListener saves reference to the PreparedStatement (whics executes updates) in order to call PreparedStatement.cancel() on later) AND finishes its works (along with JSF lifecycle), but stored proc continues execution i its own Thread, now outside of JSF lifecycle.

In this scenario, one question comes to mind :
Stored proc changes some database data, which needs to be displayed on the JSF page. How to detect that stored proc's thread finished its execution (or that exception happens), in order to refresh User interface with a new data ?

However (forget for stored proc for now), the main question is : how to cancel long-running JSF actionListener ? What needs to be done in the user interface side, and in the server side ?

Thanks in advance

   <<Less
About | Sitemap | Contact