java - OpenJPA Cache not working -


i using openjpa 2.1.0 manage entities , trying activate cache 1 of them. have followed next steps:

i have added next lines in persistence.xml file.

    <shared-cache-mode>enable_selective</shared-cache-mode>     <properties>        <property name="openjpa.datacache" value="true(types=com.example.entitytocache)"/>        <property name="openjpa.remotecommitprovider" value="sjvm"/>     </properties> 

and annotation @cacheable in entity.

    @entity     @javax.persistence.cacheable     public class entitytocache implements serializable {         @id         private string id;     } 

but cache not seem work. debugging can see entitytocache objects added cache, , cache.get method called everytime want retrieve object, calls database executed every time. failing cache.

any ideas why not working?

thanks in in advance.


Comments

Popular posts from this blog

How do you convert a timestamp into a datetime in python with the correct timezone? -

c# - how to use buttonedit in devexpress gridcontrol -

how to display 2 form fields on same line with bootstrap -