You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "rzo1 (via GitHub)" <gi...@apache.org> on 2026/09/02 18:08:58 UTC
[PR] [OPENJPA-2974] Convert String cache mode properties to their enum again [openjpa]
rzo1 opened a new pull request, #174:
URL: https://github.com/apache/openjpa/pull/174
`convertToKernelValue()` returned a String value for `cache.retrieveMode` and `cache.storeMode` untouched. Since this PR the bean property for those keys resolves to the new JPA 3.2 setters on `EntityManagerImpl`, which take the jakarta enums, so `em.setProperty("jakarta.persistence.cache.retrieveMode", "USE")` reached `Method.invoke` with a String and died with an argument type mismatch. The same applies to the map passed to `createEntityManager()`, so this affects ordinary configuration, not only the new API.
The conversion is now driven by the target type rather than by the key: a value already of the target type passes through, a String is parsed into the target enum, and an enum of a different type is mapped by constant name — which is what lets a jakarta `CacheStoreMode` reach a kernel `DataCacheStoreMode`. An unusable String now fails with a message naming the property and its legal values. The early return this replaces cannot simply be dropped: it was added together with those setters and is what keeps the enum-valued form working.
Being type-driven, it also fixes `jakarta.persistence.lock.scope="EXTENDED"`, which failed in `StringUtil.parse` with "Unsupported type".
A null mode now resets the fetch plan to its default rather than meaning BYPASS, so clearing one of these properties does not leave the plan bypassing the cache; both setters document that.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [OPENJPA-2974] Convert String cache mode properties to their enum again [openjpa]
Posted by "cristof (via GitHub)" <gi...@apache.org>.
cristof merged PR #174:
URL: https://github.com/apache/openjpa/pull/174
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@openjpa.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org