either u have to implement SingleThreadModel interface or u have to make a method Synchronise which is to be invoked by multiple users. this is upto ur application , wheter it is single user or multiuser where multiple users r supposed to acces it .
kishor, JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "u" instead of spelling out "you" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.
I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.
1. Create static data in init() method so it will be created only once and create dyanamic data in service() method. 2. Use StringBuffer instead of using + operator with string when you concatenate multiple strings 3. Dont user println() method, use print() method as println() internally calls print() method. 4. Always initialize the PrintWriter with proper size 5. flush the data 6. dont put unnecssary code in sysnchronized blocks if you are using in service() method. 7. always clean up the resoruces like JDBC connections, sockets in destroy() method 8. dont put unnecssary data in session. 9. choose the rite session mechanism. 10. remove session explicitly when you dont require the session. 11. disable servlet reloading if the servlet is not required to load always. 12. Use 'transient' variables to reduce serialization overhead if your HttpSession tracking mechanism uses serialization process. 13. use session time out value to reduce the session time
I have to say that about half of that list is useless and misdirected in terms of real world servlets. Furthermore you left out - choose the right architecture / algorithms. First make your code clear and bug-free, Then if you have a performance problem - follow the advice of the other old-timers as given above. For your own amusement, do a google search for "premature optimization is the root of all evil" Bill