开发者

ignore Castle ActiveRecord connection failure

开发者 https://www.devze.com 2023-02-05 23:24 出处:网络
I am using castle activerecord to persist my domain objects to a sql server database. If for whatever reason the database connection fails i need to be able to ignore it and carry开发者_JS百科 on with

I am using castle activerecord to persist my domain objects to a sql server database. If for whatever reason the database connection fails i need to be able to ignore it and carry开发者_JS百科 on with the opperation of the program.


You can't ignore connection errors. It's up to you to decide what to do in case of a connection failure. For example, if you query for some User entities and there's a connection error, what should NHibernate/ActiveRecord return? It can't possibly make up results.

If you're working with an occasionally connected scenario, see this question.

0

精彩评论

暂无评论...
验证码 换一张
取 消