Я работаю над кешем на проекте Jhipster. Я хочу использовать кеш для User Entity.Jhipster: Почему кеш не работает?
@Entity
@Table(name = "jhi_user")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class User extends AbstractAuditingEntity implements Serializable {
// attributes, getters and setters
}
настроить ehcache.xml файл:
<cache name="com.domain.User"
timeToIdleSeconds="1800"
timeToLiveSeconds="3600">
</cache>
DEV YML файл
spring:
devtools:
restart:
enabled: true
livereload:
enabled: false # we use gulp + BrowserSync for livereload
datasource:
url: jdbc:postgresql://localhost:xxx/cccccccc
name: ccc
username: cc
password: cc
jpa:
database-platform: com.util.PostgreSQL82Dialect
database: POSTGRESQL
show_sql: true
properties:
hibernate.cache.use_second_level_cache: true
hibernate.cache.use_query_cache: true
hibernate.generate_statistics: true
hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.EhCacheRegionFactory
jhipster:
cache: # Hibernate 2nd level cache, used by CacheConfiguration
timeToLiveSeconds: 180
ehcache:
maxBytesLocalHeap: 16M
Когда я войти мой пользователь приложения будет получать из базы данных. Я выхожу из системы и вхожу в систему, пользователь всегда извлекает из базы данных. Можно ли добавить еще одну конфигурацию? Спасибо