title: Spring Cache @Cacheable - not working while calling from another method of the same bean
body: <p><strong>Spring cache is not working when calling cached method from another method of the same bean.</strong></p>
  
  <p>Here is an example to explain my problem in clear way.</p>
  
  <p>Configuration:</p>
  
  <pre><code>&lt;cache:annotation-driven cache-manager="myCacheManager" /&gt;
  
  &lt;bean id="myCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"&gt;
      &lt;property name="cacheManager" ref="myCache" /&gt;
  &lt;/bean&gt;
  
  &lt;!-- Ehcache library setup --&gt;
  &lt;bean id="myCache"
      class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:shared="true"&gt;
      &lt;property name="configLocation" value="classpath:ehcache.xml"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;cache name="employeeData" maxElementsInMemory="100"/&gt;  
  </code></pre>
  
  <p>Cached service :</p>
  
  <pre><code>@Named("aService")
  public class AService {
  
      @Cacheable("employeeData")
      public List&lt;EmployeeData&gt; getEmployeeData(Date date){
      ..println("Cache is not being used");
      ...
      }
  
      public List&lt;EmployeeEnrichedData&gt; getEmployeeEnrichedData(Date date){
          List&lt;EmployeeData&gt; employeeData = getEmployeeData(date);
          ...
      }
  
  }
  </code></pre>
  
  <p>Result :</p>
  
  <pre><code>aService.getEmployeeData(someDate);
  output: Cache is not being used
  aService.getEmployeeData(someDate); 
  output: 
  aService.getEmployeeEnrichedData(someDate); 
  output: Cache is not being used
  </code></pre>
  
  <p>The <code>getEmployeeData</code> method call uses cache <code>employeeData</code> in the second call as expected. But when the <code>getEmployeeData</code> method is called within the <code>AService</code> class (in <code>getEmployeeEnrichedData</code>), Cache is not being used.</p>
  
  <p><strong>Is this how spring cache works or am i missing something ?</strong> </p>