This caching has been discusses a lot but I have this problem that it is not very clear for me how to solve.
What I need is to have the data cached in such a way that I can do updates in the underlying database and in the cache itself. Some data would be updated once a day but other could be updated more frequently.
For updates I would use JMS to concurrently (speed up) get new data from external sources (accessing the sources or getting notifications from them), process it and persist it to the db (having the new data accessible through the cache) and I would have clients accessing the data/cache to generate reports/calculations on it.
Now in every operation (stateless bean) I read the data with queries (a stateless bean for managing - reading/updating/etc - the existing entity beans) that takes a lot of time so I think that I need some kind of caching. Time is quite essential.