• Post Reply Bookmark Topic Watch Topic
  • New Topic

Controlling an MDB task  RSS feed

 
Ragav Baskaran
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my application i have an option for the user to select few inputs and based on the input report will be generation. This report generation is a big task and it can take hours for completion to generate a single report.

In the above scenario the user inputs entered are wrapped in a JMS message object and pushed in to a queue. The listener picks the information and delegate the call to a 3rd party java reporting library for actual report generation.

Question here is, By mistake lets assume the user has entered few wrong inputs or he wish to edit some inputs for this task in that case the how do i cancel(as this is a big task i need to cancel it somehow and dont want to wait for its completion) the already running task and initiate a new task?

Thanks.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to this question lies in what 3rd party Java reporting library you are using. In case the library allows you to provide a hook or callback method then you can always maintain a database table. The status column can be checked periodically by the callback method to cancel the report.

So the user modified the task request, you can change the status to Cancel and the callback will look at the status and quit the task. In the case the library doesnt allow you any such thing then I dont think you have any choice left.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!