-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Upgrade Hibernate to 5.x #1113
Comments
Thank you Andrei for this (among several others) improvement ! |
@tomparle @xael-fry Can anyone tell why the third line saves Horse existing = Horse.all().first(); // existing.bulp == null
existing.setBlup(new BLUP());
em().flush(); // why it executes "insert into BLUP (id, total) values (null, ?)" ??? |
@asolntsev maybe it should be fixed in current play to? https://github.com/playframework/play1/blob/master/framework/src/play/db/jpa/JPA.java#L364 The key-pattern for properties should honor thx |
It should have a ticket in lighthouse and should be fixed for 1.4.x too. The current AUTO-FlushMode has unpredictable consequences. |
@asolntsev Maybe you should look into |
I agree with @flybyray we should keep |
Implemented in PR #1114 |
Just testing my application with the new Hibernate 5.2.x support and I run into this exception below with my existing MySQL database. I fixed the exception by adding this property "hibernate.id.new_generator_mappings=false" to the application.conf as suggested by the best answer in this StackOverflow entry, "Hibernate-sequence doesn't exist" Looks like this could be a common situation and maybe this property should be included in the default application.conf. wdyt?
|
Yes, this is because At the beginning I also got similar errors and added this setting. But later I discovered that there is a better solution. I re-configured my DB to properly use In your case, you use MySql which supports |
@asolntsev I've been using MySQL's auto increment feature from the beginning. I think the use of sequences is being activated by the combination of the @GeneratedValue annotation on Model.id and |
@tazmaniax So, what you suggest? |
@asolntsev ok after doing some more digging I've found that the behaviour change in 5.x is not compatible with MySQL autoincrement and is explained in detail in this blog article. The author also raised a Hibernate JIRA ticket but by the sounds of it it has been rejected by the core Hibernate team for reasons unknown. The initial suggested work around is to add In the end I think will just stick with Sorry for the distraction but maybe this is useful for someone else who comes across this :) |
@tazmaniax Yes, sure, it can be useful for many people. |
@tazmaniax it was, thanks for the explanation! |
Currently Play1 uses Hibernate 4.2.19 which is pretty old.
Need to upgrade to Hibernate 5.2.5 (or later).
See https://play.lighthouseapp.com/projects/57987-play-framework/tickets/1818-hibernate-need-to-be-updated-to-v435#ticket-1818-6
The text was updated successfully, but these errors were encountered: