休眠:hbm2ddl.auto =生产中更新? [英] Hibernate: hbm2ddl.auto=update in production?

查看:109
本文介绍了休眠:hbm2ddl.auto =生产中更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以运行配置了 hbm2ddl.auto = update 的Hibernate应用程序来更新生产环境中的数据库模式吗?

更新生产。编写你自己的补丁,用DBA检查它们,测试它们,然后手动应用它们。理论上,如果 hbm2ddl update 在开发中工作,也应该在生产中工作。但实际上并非总是如此。

即使它行得通,它也可能是次优的。 DBA因为某种原因付出了很多。

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

解决方案

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.

这篇关于休眠:hbm2ddl.auto =生产中更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆