-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panache EntityBase should flush on the right entity manager #24470
Conversation
You saw me coming but no tests? We should at least have a test that calls the method to make sure it doesn't fail altogether. |
@gsmet there is already test on this method, I'm not sure we can easily check that we flush the right entity manager. The current test call the method but made no assertion. This is also a breaking change but I don't think there is a hight risk that someone rely on the wrong behaviour of the current situation. |
OK, good, then. |
Well, hum, I'm a little ashame as tests didn't pass and I didn't notice it because I use |
This comment has been minimized.
This comment has been minimized.
@gsmet it can work with this hacky code (I need to add safeguard to it to cover possible corner cases):
This issue is that I need to find the entity class wich is the parameterized type of the PanacheRepository/PanacheRepositoryBase interface or any custom interface or abstract type that a user may define on top of them ... Even if it's less practicle to use, I wonder if we should deprecate |
Don't we already have code that could take care of that when generating the classes? I mean it's not a good idea to resolve that at execution time given we know what it will be at build time. And no, we don't want a |
@gsmet yes but it didn't work for flush, I'll dig a little more, I don't want a |
@gsmet the current PR should fix the issue, the flush method on the Java Panache repository was not correct (the Kotlin one was) as it didn't use the bytecode enhancement |
Fixes #24394