Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Number of users restriction

 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In a Web-J2EE application deployed on WebSphere, I'm looking for a way to restrict the number of users.

For exemple, if I allow 10 users, I want the 11th who tries to login to be rejected.
Is there any simple way to do that ?

TIA,
 
Arvind Shukla
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set max in-memory session count property to 10 in web container using admin console. Also inside your entry servlet where you are obtaining session for a successfully authenticatde user, you need to put a check (import this package in your code com.ibm.websphere.servlet.session)
IBMSession sess = (IBMSession) request.getSession();
if(sess.isOverFlow()) throw new ServletException("Maximum number of sessions reached on the server");
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Arvind .

But how can it work on a clustered environment ??
Can I define the max-session for a whole cluster ?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic