Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling multiple requests  RSS feed

 
Zoram Paul
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody.

I have developed an application which purpose is to shorten a lenghty url entered by the user.

You can check it at http://vividurl.com

This is what my client concluded after the development of the website.

*************************************************************************************
We were using this as a way to simulate concurrent requests for alias
generation. Because all HTTP requests are "stateless", it doesn't matter
where they come from, one IP or multiple IPs. Web application (your code)
treat each as just another request. It didn't pass this test.

One even bigger problem was that this application is not capable of
correctly handling multiple requests. i.e. while the system is handling one
alias-generation request, before the result is returned to user, if another
user request comes in during this period, the system will return two
IDENTICAL alias to both users -- this is unacceptable for any web
application.
*************************************************************************************



Please advice me how to overcome these problems.

Thanks a loads.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if another
user request comes in during this period, the system will return two
IDENTICAL alias to both users


This indicates that you have not properly isolated parts of your code. Frequently this is due to using instance variables which contain user specific values in a servlet.

Bill
 
Zoram Paul
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry!!
That is not the right answer.

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Zoram Paul:
That is not the right answer.

Since you know that, what is the right answer?
 
Ryan Muster
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ULF must be right...
Sometimes though it can be difficult to spot, but this is really simple stuff you doing so why dont you post the code.

I'm betting you grabbing the URL and storing it in a global variable.
Then your alias routine read that and stores in the dB...

Something like that... any changing global variable is bad news in a servlet. If you doing it in JSP... oh well ;)
Then look at the compile JSP... theres a global snookering you ;)
 
Zoram Paul
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,
No,

That is not the right answer too.

[ UD: Oops, I mistakenly edited this post instead instead of replying. Will post for real now. ]
[ November 15, 2007: Message edited by: Ulf Dittmer ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No,
No,

That is not the right answer too.

Are you intending to make this a riddle? If you know what is not the answer, then you should tell us why that is the case. That would give us a clue to help you farther.
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check code in declaration part of your jsp.
it must have some variable holding URL alias.

if possible, post the code.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zoram Paul, please check your private messages.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!