Stopping a very time consuming class method's execution on tomcat server using JSP.

Reply

Join Date: Jan 2008
Posts: 3
Reputation: dkerberwra is an unknown quantity at this point 
Solved Threads: 0
dkerberwra dkerberwra is offline Offline
Newbie Poster

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #11
Jun 5th, 2008
I only posted because I didn't see any other responses at the time. I wouldn't have said a word if I had seen that first response; the author obviously has a much better handle on it than I do.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,642
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 471
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #12
Jun 5th, 2008
> As far as the programmer making a mess of the programming, that can always happen.

Though the probability increases in this case. :-)

> And, I never said he should call thread destroy, or anything in that manner.

I guess I misread your first post.
The stop button will call another jsp that will retreive the object stored under that key and call the "stop" method.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,450
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 262
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #13
Jun 5th, 2008
Sorry. It's explained (better, although still not perfectly) in the next post.

The stop method should interupt this thread and perform and needed cleanup.
;-)
Last edited by masijade; Jun 5th, 2008 at 3:10 pm.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #14
Jun 6th, 2008
NEVER use Thread.stop(). It's extremely dangerous and will more likely than not cause very nasty things to happen.
It's deprecated for a reason you know, and that reason is that it will NOT do any cleanup.
It will kill the thread, and everything in it, now. No questions asked.
If that leaves data in an incomplete or unstable state, it doesn't care. If it leaves network or database resources open it couldn't care less. If it keeps hardware locked, waiting for commands that never can come no more, it's oblivious of that.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,450
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 262
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #15
Jun 6th, 2008
Originally Posted by jwenting View Post
NEVER use Thread.stop(). It's extremely dangerous and will more likely than not cause very nasty things to happen.
It's deprecated for a reason you know, and that reason is that it will NOT do any cleanup.
It will kill the thread, and everything in it, now. No questions asked.
If that leaves data in an incomplete or unstable state, it doesn't care. If it leaves network or database resources open it couldn't care less. If it keeps hardware locked, waiting for commands that never can come no more, it's oblivious of that.
Yes. I know. Read again, that was suppossed to be self-written "stop" method in a class that created the thread (not the one from the thread class) designed to call interrupt on the actual thread and then perform some clean-up.

Edit: And yes, it was a very poor choice of a name, and it caused the confusion, but hey, at least I knew what I meant. ;-)
Last edited by masijade; Jun 6th, 2008 at 12:10 pm.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #16
Jun 7th, 2008
of course including any such method in a JSP (which the kid was asking for) is as bad as calling Thread.stop()...
It's likely going to be ineffective as well, as the thread may well survive the context in which the JSP is executed.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 1
Reputation: unicode is an unknown quantity at this point 
Solved Threads: 0
unicode unicode is offline Offline
Newbie Poster

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #17
Jun 9th, 2008
Originally Posted by masijade View Post
That was quick. I'm glad I was able to help.
Dear masijade,

Can u plz help me out in similar kind of proble?
My Server is having two Consecutive very long process having lon time on JBOSS server 4.0.2, how can I make my client to wait till the process ends and responce in JSP apge.

Thanks
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Stopping a very time consuming class method's execution on tomcat server using JSP.

 
0
  #18
Jun 9th, 2008
that's a different problem, and one you can't solve.
The server will time out the request, and even if not the client will at some point time out the request.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for JSP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC