This is how my entity look like
@Entity
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Table(name = "TestPojoOnly")
@NamedQueries({@NamedQuery(name = "TestPojoOnly.findAll", query = "SELECT h FROM TestPojoOnly h"), @NamedQuery(name = "TestPojoOnly.findById", query = "SELECT h FROM TestPojoOnly h WHERE h.id = :id"), @NamedQuery(name = "TestPojoOnly.findByCategoryname", query = "SELECT h FROM TestPojoOnly h WHERE h.categoryname = :categoryname")})
public class TestPojoOnly implements Serializable {
my ehcache.xml
<cache name="com.package.model.TestPojoOnly"
maxElementsInMemory="200"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"
/>
Q. I already set time to Zero and eternal to false, but when i try load entity from db. it still get from cache. time=0 that mean no cache right? did i miss out something?
ref: my appcontex.xml at http://www.copypastecode.com/16833/