I am writing an application that uses both the entity cache and the query cache. We are using TreeCache with optimistic locking enabled. We are in the middle of performance tuning the application and we need to choose between REPL_SYNC and REPL_ASYNC. According to the
JBossCacheHibernate Wiki the recommended setting is REPL_SYNC when using both the query cache and entity cache. This is confusing since the recommended setting when using only the query cache is REPL_ASYNC.
What are the possible problems with using REPL_ASYNC when an application uses both entity and query caching? Can this cause data integrity issues, or is the recomendation merely from a performance point of view?