• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

desin issue

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
vijaya bacina
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about CachedRowset or making an xml file from database records when user logs in and removing it when log off???
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want it closer to you than the database you probably want it in memory. What's wrong with the Session for that? I can make up some reasons it might be bad, but I'm interested in your reasons.

Another choice might be some kind of global cache, but "global" usually is A Very Bad Thing so let's not go there.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vijaya bacina:
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.



Store it in a 3rd medium? If its not on the database and not in session, then its got to be stored locally because thats all you have left. Perhaps a local temporary file?
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reading again the next day, I might take back the evil global stuff. This is common enough:

From this code we don't know if ConfigurationMgr goes to the database or XML or resource file or whatever every time or keeps data somewhere. It would be ok for Mgr to keep a static Map and say:

Be sure to make an administrative interface so you can clear that cache without stopping and starting the server. Think about ways to keep the cache from growing too large ... delete the least recently used, the least frequently used, the oldest, some other algorithm.
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic