Hibernate: hbm2ddl.auto=update in production?

cretzel picture cretzel · Oct 21, 2008 · Viewed 169.4k times · Source

Is it okay to run Hibernate applications configured with hbm2ddl.auto=update to update the database schema in a production environment?

Answer

Vladimir Dyuzhev picture Vladimir Dyuzhev · Oct 21, 2008

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.