• Post Reply Bookmark Topic Watch Topic
  • New Topic

Killing a Message Driven Bean?  RSS feed

 
John Bones
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Once I have an MDB processing, say, a large SQL query that may run for several hours, is there a programmatic way of killing the process? For example, if a user clicks a link on the form to cancel the process how do I tell the process to die?

The only solution I have seen is to use a semaphore based approach - check a row in the database to see what action needs to be taken by the bean but this won't work for long, single action transactions such as a huge SQL query as there is nowhere available in the code to check this value.

Any ideas?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Bones"

Thanks for joining JavaRanch, please take some time to review the JavaRanch Name Policy then update your publicly displayed name in your profile so that it complies.
 
John Bones
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fixed - now can someone answer my question?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are we talking about a run-away query here? What are you doing that would require a query to run for hours? This doesn't sound like something you should allow the user to control... if you have reporting requirements that actually call for this type of processing you should probably think about scheduling some batch processing for these reports and just providing links to the output.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!