Thanks for the context. Indeed, I’d love to improve on this but in terms of priorities over other issues I’m afraid this isn’t high on the list. I could also suggest to you: use the build-time enhancement plugins? We have plugins for both Maven and Gradle for people to perform the Bytebuddy enhancement phase at build time; Hibernate ORM can also do it “at runtime” but it’s indeed intended for application servers and containers. You’re right this could be documented better. Build-time enhancement also has the benefit of failing during the build in case of problems, rather than down the line, and saves resources at bootstrap. There’s a special cathegory of proxies which will require runtime enhancement (the “enhanced proxy”), so performing build-time enhancement won’t 100% protect you from leaks, but enhanced proxies are only used on certain kinds of mappings, so I expect such an approach, while not perfect, to still significantly reduce the amount of classes being defined during your integration tests. |