JPA CacheStoreMode имеет 3 варианта: USE, BYPASS и REFRE SH.
public enum CacheStoreMode {
/**
* Insert entity data into cache when read from database
* and insert/update entity data when committed into database:
* this is the default behavior. Does not force refresh of
* already cached items when reading from database.
*/
USE,
/**
* Don't insert into cache.
*/
BYPASS,
/**
* Insert/update entity data into cache when read
* from database and when committed into database.
* Forces refresh of cache for items read from database.
*/
REFRESH
}
Для USE и REFRE SH, когда объект изменяется и сбрасывается в базу данных, затем считайте его обратно , будут ли незафиксированные данные объекта помещаться в кеш?
По моему мнению, объекты не должны храниться в кеше при чтении из базы данных, поскольку они могут еще не быть зафиксированы.