Exception
http-nio-8080-exec-1 DEBUG hibernate.SQL - select hibernate_sequence.nextval from dual
http-nio-8080-exec-1 WARN spi.SqlExceptionHelper - SQL Error: 2289, SQLState: 42000
http-nio-8080-exec-1 ERROR spi.SqlExceptionHelper - ORA-02289: sequence does not exist
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
Solution
Default value for hibernate.id.new_generator_mappings setting changed to true for 5.0, in previous versions it was set to false by default
Add the following property to hibernate.cfg.xml
<property name="hibernate.id.new_generator_mappings">false</property>
OR
Add the following property to the configuration
properties.put("hibernate.id.new_generator_mappings", "false");
References
https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc#changed-setting-defaults
http-nio-8080-exec-1 DEBUG hibernate.SQL - select hibernate_sequence.nextval from dual
http-nio-8080-exec-1 WARN spi.SqlExceptionHelper - SQL Error: 2289, SQLState: 42000
http-nio-8080-exec-1 ERROR spi.SqlExceptionHelper - ORA-02289: sequence does not exist
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
Solution
Default value for hibernate.id.new_generator_mappings setting changed to true for 5.0, in previous versions it was set to false by default
Add the following property to hibernate.cfg.xml
<property name="hibernate.id.new_generator_mappings">false</property>
OR
Add the following property to the configuration
properties.put("hibernate.id.new_generator_mappings", "false");
References
https://github.com/hibernate/hibernate-orm/blob/5.0/migration-guide.adoc#changed-setting-defaults
Comments
Post a Comment