More technically correct probably Historically Hibernate would invalid the cache entries for an entity defined with multiple secondary tables (unless that entity were versioned) rather than write data for update and/or insert. This setting would allow disabling that. The reason being that the JPA 2.2 TCK started testing the provider's caching configuration by actually persisting data via EntityManager and then asking the {{javax.persistence.Cache}} implementation (Hibernate) whether that entity is cached or not. Those tests "just happen" to limit use entities defined with {{@javax.persistence.secondaryTable}} - which is funny because the invalidation checks secondary tables aren't even used.
Would probably be better to decide whether to disable that check or not based on the number of *optional* secondary tables , rather than just all secondary tables.
Actually we can probably just disable caching for such tables (sans this setting) in such cases. This could miss data already in the cache (infinispan cache loader, eg). |
|