Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

If stop button clicked after submit , what happned at Servlet side.

 
Mohan Karthick
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an query that if i clicked on stop just after a while i clikced on submit button which os going to call servlet and processing some database query.
same if I clicked on back button or forward button.

Thanks in Advance.

Mohan
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, all three would break the current connection.
Back and Refresh will start new connections.

On the server side a broken connection exception will be thrown.
You can see this in your container's logs.
[ June 13, 2005: Message edited by: Ben Souther ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the little server I wrote the error is not detected until all the heavy server processing is done and I start to write the response. Is that true in serious servers as well or have they found a way to kill whatever task the server is running for the user? Hitting refresh a few times while a long-running query is executing can cause a lot of these errors in a hurry!
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's interesting question. I believe servlet should continue sending something to a browser when processing a request and as only IO error happens, it should stop processing and roll back any changes. The trick is that no actual IO exception rosen, so you have to call checkError() to figure out that a browser stopped accepting your stream. I doubt that majority of servlet developers use this technology. Of course it isn't relevant how big and complex servlet container used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic