Is it okay to run Hibernate applications configured with hbm2ddl.auto=update
to update the database schema in a production environment?
Java – Hibernate: hbm2ddl.auto=update in production
hbm2ddlhibernatejava
Related Topic
- Java – How to set JAVA_HOME environment variable on macOS X 10.6
- Java – Hibernate throws MultipleBagFetchException – cannot simultaneously fetch multiple bags
- Ios – Perform on Next Run Loop: What’s Wrong With GCD
- Hibernate hbm2ddl.auto, possible values, and what they do
- Java – What does “Could not find or load main class” mean
- Java – Why is printing “B” dramatically slower than printing “#”
Best Answer
No, it's unsafe.
Despite the best efforts of the Hibernate team, you simply cannot rely on automatic updates in production. Write your own patches, review them with DBA, test them, then apply them manually.
Theoretically, if hbm2ddl update worked in development, it should work in production too. But in reality, it's not always the case.
Even if it worked OK, it may be sub-optimal. DBAs are paid that much for a reason.