This is my first attempt to add caching to Spring - thanks for your patience
Can I please ask if there is an basic guide to adding ehcache to a Spring Boot - Spring Rest, Spring JDBC, Oracle 11g project
Spring Boot 2.0.6
ehcache 3.6.2
JDK 1.8
OS is Win 7 64b
I see a post in the forum by Louis Jacomet - just wondering if this is targeting Boot or Spring traditional
thanks
So far I have added
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</dependency>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ehcache.org/ehcache.xsd"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true">
<cache name="instruments"
maxElementsInMemory="100"
eternal="false"
overflowToDisk="false"
timeToLiveSeconds="300"
timeToIdleSeconds="0"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off">
</cache>
</ehcache>
on the DAO impl class
@Cacheable("staticRoles")
public List<StaticRoleDto> getStaticRoles() {
... calls an Oracle procedure
This seems to work but wonder if I am just using the default basic class or ehcache
{do I need to configure a manager }