• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Cache

 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a project with EAServer and Sybase DB. We are cacheing some ids in our EJB like this. We have static member variables:

private static String buArcPerTraitID = null;

And methods like this

This is our Cacheing mechanism. To avoid running SQL constantly. This data is fairly constant. Only changes from differing environments. This is in a stateless session bean. This seems like poor design. I have look through this forum and seen mention of using a singleton class as a possible solution. I am going play around with that. Is there any other suggestions anyone would like to offer. I am open to anything.
Thanks,
Tom
 
rishindra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Singleton a good way to achieve caching. The only view i would like to add is, load this singleton class at the time of server startup. And design a way to refresh this cache at runtime if required.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!