0
私はJhipsterプロジェクトのキャッシュに取り組んでいます。ユーザーエンティティでキャッシュを使用したい私は、データベースからフェッチされた私のアプリケーションのユーザーでログインするとJhipster:キャッシュが機能しないのはなぜですか?
<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
:
@Entity
@Table(name = "jhi_user")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class User extends AbstractAuditingEntity implements Serializable {
// attributes, getters and setters
}
私はehcache.xmlファイルを設定します。ログアウトしてログオンすると、ユーザーは常にデータベースからフェッチされます。 追加する別の設定はありますか? ありがとう