如何使用sequelizer 附加组件在appharbor 上运行的应用程序中启用MultipleActiveResultSets?
在本地开发时,我有一个连接字符串集,其中 MultipleActiveResultSets 设置为 TRUE。然而,当我部署我的应用程序并且续集连接字符串被注入时,MultipleActiveResultSets 被遗漏。是否有办法启用 MultipleActiveResultSets 或以其他方式更新连接字符串?
顺便说一句,我正在使用实体框架 4.1。
While developing locally, I have a connection string set with MultipleActiveResultSets set equal to TRUE. However, when I deploy my app and the sequelizer connectionString gets injected, MultipleActiveResultSets is left out. Is there anyway to enable MultipleActiveResultSets or otherwise update the connection string?
I am using Entity Framework 4.1 by the way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新:现在可以使用 Sequelizer 管理面板为注入的连接字符串启用多个活动结果集 (MARS)。这是推荐的方法,因为不再需要修改
web.config
,这会导致AppDomain
在启动期间重新加载您可以从 URI 构造连接字符串注入到您的应用程序
web.config
中。该过程描述此处,但我也包含了下面的代码片段:请注意
MultipleActiveResultSets = true
。如果您还需要构建非代码优先连接字符串,则需要使用
EntityConnectionStringBuilder
来完成其余部分,例如:(也已回答在 AppHarbor 支持论坛上)
Update: Multiple Active Result Sets (MARS) can now be enabled for the injected connection string by using the Sequelizer admin panel. This is the recommended approach since the
web.config
no longer needs to be modified, which causes anAppDomain
reload during startupYou can construct the connectionstring from the URI injected into your application
web.config
. The process is described here, but I'm including the snippet below too:Note the
MultipleActiveResultSets = true
.If you need to also build a non-Code-First connectionstring, you then need to use a
EntityConnectionStringBuilder
for the rest, eg.:(also answered on the AppHarbor support forum)