Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Single Session at a Time 1

Status
Not open for further replies.

SwapSawe

Programmer
Apr 24, 2001
148
US
Hello All !!!

What is the best way, performance wise, to ensure, one user can initiate only a single session and if he tries to initiate another session, while logged in, he should get an error page, saying your session is currently active?

One of the ways I could think of is keeping user login info in context and search through the list before creating a session for him, but it does not seem good, as the number of users can be upto 1000 at a give instance.

Is there a built in functionality or if some one has implemented such a scenario, it would be of immense help.

Thanks,

Regards,

SwapSawe.

Cheer Up, The worst is yet to Come.
 
Dear sedj !!!

Using a db mighnot be suiting for best performance, as this would involve call to db which may take time, considering number of users (may be 1000).

Dear feherke !!!

That was really a nice catch you found out. I wonder why did not I think of it.

Thanks to both of you.

Regards,

SwapSawe.

Cheer Up, The worst is yet to Come.
 
>>>> Using a db mighnot be suiting for best performance, as this would involve call to db which may take time, considering number of users (may be 1000).

Using a db is a far more sutiable and scalable solution, especially if you have a lot of users. I think, if you used connection pooling, you could achive a login-check procedure in around 200 milliseconds on a decent db.


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top