Hi,
i'm not sure i'm at the right place since it is a beta release.
We wanted to try elasticsearch so we updated to 5.8.0.Beta1, but since we updated, hibernate wouldn't create schema anymore.
This is how we build our sessionfactory :
Code:
Configuration conf = new Configuration();
conf.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
conf.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
conf.setProperty("hibernate.connection.url", "jdbc:mysql://host:3306/"+dbName+"?characterEncoding=utf-8"
+ "&verifyServerCertificate=false&useSSL=true&requireSSL=true");
conf.setProperty("hibernate.connection.username", "username");
conf.setProperty("hibernate.connection.password", "password");
conf.setProperty("hibernate.connection.verifyServerCertificate", "false");
conf.setProperty("hibernate.connection.requireSSL", "true");
conf.setProperty("hibernate.connection.useSSL", "true");
conf.setProperty("hibernate.connection.CharSet", "utf8");
conf.setProperty("hibernate.connection.characterEncoding", "utf8");
conf.setProperty("hibernate.connection.useUnicode", "true");
conf.setProperty("hibernate.connection.autoReconnect", "true");
conf.setProperty("hibernate.default_schema", "dbName");
conf.setProperty("hibernate.show_sql", "false");
conf.setProperty("hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider");
conf.setProperty("hibernate.id.new_generator_mappings", "false");
conf.setProperty("hibernate.globally_quoted_identifiers", "true");
conf.setProperty("hibernate.current_session_context_class", "org.hibernate.context.internal.ThreadLocalSessionContext");
conf.setProperty("hibernate.hbm2ddl.auto", "update");
conf.setImplicitNamingStrategy(new CustomNamingStrategy());
conf.setProperty("hibernate.search.default.indexmanager", "elasticsearch");
conf.setProperty("hibernate.search.default.elasticsearch.host", "elasticsearchurl");
conf.setProperty("hibernate.search.default.elasticsearch.index_schema_management_strategy", "none");
conf.setProperty("hibernate.search.default.elasticsearch.required_index_status", "yellow");
// ... add persistence classes here ...
conf.buildSessionFactory(new StandardServiceRegistryBuilder().applySettings(conf.getProperties()).build());
If we remove everything that relate to elasticsearch, the same problem occurs, the schema won't update.
The only way we found was to put back hibernate-search 5.7.0.Final. I don't know why thought.
I think this might be related but if we just execute a main with just the above code, there seems to be 8 "Hibernate-search: elasticsearch transport thread [number]" hanging and program won't close.
I'm wondering if hibernate is waiting for those threads and won't call directly mysql.
Same thing when we run it in Tomcat. After closing the server, it will run indefinitely until tomcat pop the message "server didn't stop in time, do you want to wait or kill process...".
If we enable hibernate sql log. We can clearly see the create table and every alter table. But nothing on the database is modified.
- Thanks, and let me know if i'm not at the good place to post this.
EDIT: After debugging hibernate code, we noticed that there was a quiet error while hibernate was trying to create a myIsam table. Changing code worked :
Code:
conf.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5InnoDBDialect");
I don't know how the 5.8.0.Beta1 release can conflict with this.
This still does not fix the hanging thread problem thought.