I have read the following pages and I have several doubts.
About the persistence context type for Level 1 cache What is the difference between Transaction-scoped Persistence context and Extended Persistence context?
About the Level 2 cache http://www.objectdb.com/java/jpa/persistence/cache
Now, my questions are:
- In a normal situation what is the best PersistenceContextType to choose for L1 cache, TRANSACTION or EXTENDED? I suppose the answer is TRANSACTION as it is the default. However I would like to know when should I use EXTENDED.
- In a normal situation what are the best values to choose for the
following porperties of L2 cache?:
- javax.persistence.sharedCache.mode (I suppose the answer is ALL as it is the default and caches all the entities)
- javax.persistence.cache.retrieveMode (I suppose the answer is USE as it is the default and uses the cache on retrieval)
- javax.persistence.cache.storeMode (I suppose the answer is USE as it is the default, however I still don't understand the difference with REFRESH which seems better for me)
Can someone explain how to correctly put these properties of L1 and L2 correctly and explain when to use some values or others?