-
Notifications
You must be signed in to change notification settings - Fork 106
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
2.8.7 NoSuchMethodError PersistentCollection.setCurrentSession #104
Comments
So, just to make sure I understand: is this a proposed patch to fix another problem? |
It is another problem, yes. I could not find my old logs for the first problem and how to recreate it. It seems the other problem merely prevented us from getting to this one. |
@coladict Ok. Very unfortunate that supposed patch only pushed bottleneck bit further then. |
It turns out in 5.1 the Session not yet an EntityManager, so the I've made a test for it http://pastebin.com/6ZuLgNS9 but I can't spare more time right now to make it work in both cases. |
@coladict ugh. That's even worse then... It is possible to have different module altogether, if need be. But form user perspective that wouldn't be particularly good thing. |
You could have one class handle 5.1 and another 5.2 and just load the appropriate object on initialization. Of course, either one or both would have to use reflection for that, depending on what you compile against. |
They changed the signature of the method in 5.2 and now instead of
SessionImplementor
it takesSharedSessionContractImplementor
.This fixed it.
If you migrated to Gradle you could actually test different provider versions in the same build.
For example, I managed to do it like this https://github.com/mopano/hibernate-json-type/blob/d25edecea9cab619207e4888c850c96bc65f10ea/build.gradle
Lines 28-32 define configurations for each provider;
Lines 50-52 define dependency for each configuration;
Lines 62-81 define new test tasks for each provider configuration.
Lines 66, 73, 80 set classpaths for each task accordingly.
That's the kind of flexibility Maven will never provide.
With this patch it managed to serialize my object that was crashing after it had just been persisted.
The text was updated successfully, but these errors were encountered: