NHibernate的SchemaUpdate安全的生产代码? [英] Is NHibernate SchemaUpdate safe in production code?
问题描述
我的问题是,它是否足够可靠地离开生产代码。显然,每次程序在生产环境中启动时都不需要运行,但是对于增量产品更新(尽管我不打算在产品发布后对域进行任何重大更改)。 >
(也许我真正的问题应该是如何安全地使用这两个工具?)
更新
该应用程序有两个版本:独立桌面和多用户客户端/服务器。同样由于业务领域(税务软件)的性质,我每年都有一个干净的数据库开始的奢侈品。
为了能够在生产代码中运行,生产应用程序用于连接到数据库的帐户必须具有更改数据库模式的权限。
无论NHibernate代码的质量和可靠性如何,这一方面都应该阻止你使用这种方法。
For simplicity's sake. I'm using Fluent NHibernate's Automapping combined with NHibernate's SchemaUpdate during runtime. On each run Automapper creates mappings for all entity classes and SchemaUpdate applies the schema to the existing database. I was pleasantly surprised that it works correctly against an empty database as well. It's worked fine so far in a development environment and has allowed me to respond to bugs rather quickly.
My question is whether it is reliable enough to leave in production code. Obviously it doesn't need to run every time the program starts in a production environment but it would be useful for incremental product updates (though I don't plan on making any major changes to the domain after the product ships).
(Perhaps my real question should be how safe is it to use these two tools in conjunction?)
Update
The application has two versions: a standalone desktop and a multiuser client/server. Also due to the nature of the business domain (tax software) I have the luxury of starting with a clean database each year.
For this to be able to run in production code, the account that the production application uses to connect to your database would have to have permission to change the database schema.
That alone should deter you from this approach, irrespective of the quality/reliability of the NHibernate code.
这篇关于NHibernate的SchemaUpdate安全的生产代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!