title: Hibernate second-level cache ehcache.xml, the cache setting for entities can't be read to HIbernate
body: <p>To make it clear and easy, I have two projects:
  1. An Entity project where there are all the entity classes in this project.
  2. An project that contains a main() function to run the application, My ehcache.xml is placed in the class path of this project.</p>
  
  <p>My problem is:
  I can change the <strong>defaultCache</strong> element of ehcache.xml and I can see changes from the SQL log file. But I think the Hibernate only read my <strong>defaultCache</strong> element, because whatever I change in the <strong>cache</strong> element of a specific entity of ehcache.xml, there won't be any changes in the SQL log.</p>
  
  <p>For example:
  If I set the <em>maxElementsInMemory</em> of <strong>defaultCache</strong> element to <em>0</em>, whatever I set the <em>maxElementsInMemory</em> of the <strong>cache</strong> element of a entity to <em>100</em> or <em>0</em>, there won't be any that entity cached in the second level cache. If I set the <em>maxElementsInMemory</em> of <strong>defaultCache</strong> element to <em>100</em>, whatever I set the <em>maxElementsInMemory</em> of the <strong>cache</strong> element of a entity to <em>100</em> or <em>0</em>, there are always be that entity cached in the second level cache.</p>
  
  <p>So I think maybe the name attribute of the <strong>cache</strong> element of a entity is wrongly set and cannot be read from Hibernate?</p>