• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Singleton as cache and use ScheduledExecutorService in EJB layer - right approach?

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a requirement to cache some data (not very large data) in the business layer consisting of EJBs - version prior to 3.1. I am planning to use a Singleton for this. Also, I need to refresh this data every 6 hours and for this I am planning to use the java.util.concurrent.ScheduledExecutorService. This object will be used by stateless session beans. Are there any issues around this design - especially in terms of using the schedular inside the EJB container (though I am using it in a POJO and not in managed beans)? Or any other concurrent issues? Are there any other better approaches?

It'll be helpful to recieve thoughts/ideas/opinions.

Thanks in advance,

-Milind
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic