Check a system property before EntityManager injection outside work unit happens#997
Check a system property before EntityManager injection outside work unit happens#997nuzayats wants to merge 6 commits intogoogle:masterfrom
Conversation
…on before implicit EntityManager injection happens.
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed it! |
|
CLAs look good, thanks! |
|
@sameb Why don't you make injection process of Any feedback or thoughts greatly appreciated :) |
…because it leads to leaks. Fixes #739, fixes #997, fixes #730, fixes #985, fixes #959, fixes #731. This also adds an optional Options to the JpaPersistModule constructor, if users wish to use the legacy behavior. This is a breaking change, but to a better default value. Users who want to keep the dangerous form can opt back in with the options. PiperOrigin-RevId: 525852009
…because it leads to leaks. Fixes #739, fixes #997, fixes #730, fixes #985, fixes #959, fixes #731. This also adds an optional Options to the JpaPersistModule constructor, if users wish to use the legacy behavior. This is a breaking change, but to a better default value. Users who want to keep the dangerous form can opt back in with the options. PiperOrigin-RevId: 525852009
There are many folks who complains about implicit EntityManager injection because it very likely to bring EntityManager leakage:
#739
#730
I think it's reasonable to check a system property before implicit injection happens. it has no compatibility breakage, and simple.
Inspired by workaround of this: https://issues.apache.org/jira/browse/COLLECTIONS-580