This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Design problem with Session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Design problem with Session" Watch "Design problem with Session" New topic
Author

Design problem with Session

Siva Jagadeesan
Ranch Hand

Joined: Oct 31, 2000
Posts: 160
Hi everybody :
i am workin in a system . Let me give u an example . there is a student and a admin . they have different level of access to them system . A student can take the test . A admin can delete edit or add student record. Okay .
So when a student logs is details are taken from the database and stored in the session as UserBean . When the studend is takin the exam how can not allow the Admin not to delete the student from the database???
is there anything i can do like Can i add a the Users who log in in a different Bean of scope Application . If this is a good way then how can i add the Bean in Application scope in a Servlet
pls help me here
i am stuck
Thank you
Siva


Rgds<p>--Siva Jagadeesan<br /><a href="http://java2simple.blog-city.com" target="_blank" rel="nofollow">http://java2simple.blog-city.com</a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Storing the student data in both the session and the database, where the database may be modified by the instructor sounds like a recipe for disaster. In my courseware, there is only one copy of the student data and it has synchronized access. Both the student and instructor Threads access the same copy of the data - every now and then this copy is backed up to a disk file.
Bill

------------------
author of:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Design problem with Session