aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Singleton as cache and use ScheduledExecutorService in EJB layer - right approach? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Singleton as cache and use ScheduledExecutorService in EJB layer - right approach?" Watch "Singleton as cache and use ScheduledExecutorService in EJB layer - right approach?" New topic
Author

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

Milind Mahajan
Ranch Hand

Joined: Oct 23, 2000
Posts: 77
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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Singleton as cache and use ScheduledExecutorService in EJB layer - right approach?
 
Similar Threads
Injecting a session bean into an application bean
Consequnces of not using Google App Engine in Eclipse - GWT project
Pooling vs Instance Caches
SCEA Part II - Design Question
DAO without Factory?