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

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

问题描述

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

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

推荐答案

不,它不安全.

尽管 Hibernate 团队尽了最大努力,但您仍然不能依赖生产环境中的自动更新.编写您自己的补丁,与 DBA 一起审查,测试它们,然后手动应用它们.

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.

理论上,如果 hbm2ddl update 在开发中起作用,它也应该在生产中起作用.但实际上,情况并非总是如此.

Theoretically, if hbm2ddl update worked in development, it should work in production too. But in reality, it's not always the case.

即使它工作正常,也可能是次优的.DBA 的报酬如此之高是有原因的.

Even if it worked OK, it may be sub-optimal. DBAs are paid that much for a reason.

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

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