Discussions

General J2EE: Design issue

  1. Design issue (3 messages)

    Hi, We had a database table for maintianing system parameters for our application, user needs that information everytime through out the session. can anybody suggest a nice way to keep that data thru out session without getting it from database everytime and not keeping the whole list in session.
  2. Looks like a singleton may help you[ Go to top ]

    I might be able to suggest something specific if you can provide more details. However, your problem seems to be more of a Singleton nature. Load the system config parameters once and keep them in the application context or use an outright singleton. When you say user needs these values throughout the session, Im assuming you mean you dont need to display these values anywhere, but only use them on the server side for processing. Does that make much sense?
  3. Hi Ajay, some times i have to display those parameters on screen also. How about using cachedrowset or making a properties file when user logs in and removing it when he logsoff. I am going thru the singleton pattern docs ,and i believe it will solve my issue.
  4. Well the singleton, as you know by now, works by keeping just one sopy of the object in the JVM. So, it cannot be made user specific. If that is the case, you might be better off storing it in the HTTPsession object for the user. Remember, keeping more objects in session does not mean sending them over through the response. A heavier session object only means that the memory usage for the server will increase. you can selectively send the fields you want to display on the screen through the response object.