I have been working for several hours, I understand that users can use either an XML file (orm.xml, I suppose?), Or annotations in JPA, or both of them at the same time. I'm right? So, my project uses a second level cache that is not part of the JPA specification. And I use annotations like: @ org.hibernate.annotations.Cache (use = org.hibernate.annotations.CacheConcurrencyStrategy.READ_WRITE)
for each object. However, I think the annotation above is not a JPA annotation, so I donβt know if there is anything equivalent in orm.xml? I looked at the xml orm.xml schema, and such a hibernate element is not allowed in the schema.
If I cannot configure the second level cache in orm.xml, is there any way other than in the annotation? The reason I don't want to do this is because I have two applications, one using the READ_WRITE concurrency strategy, and the other using the READ_ONLY concurrency strategy.
Thanks in advance!
Kewei
source share