Thanks for the prompt reply.
Quote:
It must be better to use JVM level cache,
How do I do that? Please elaborate.
http://www.hibernate.org/hib_docs/refer ... ormance-s3Quote:
Close it after transaction.
But then session-level caching doesn't work???
I wan't my objects representing code tables to be cached between invocations. But if I close the session after the request, the cache is empty on the next call!
Yes, it is vissible for single thread, multiple threads see different sessions and data in cache (I do not think you want this). Session level is good in transaction, transactions are isolated any way and no synchronization needed for this cache, it must be invalidated after transaction (or placed to the global cache).
As I understand you need global cache to reuse objects in multiple threads and looks like it is trasactional in hibernate.
Thanks again.