Castle ActiveRecord - 在运行时确定连接字符串

发布于 2024-07-10 02:00:35 字数 193 浏览 3 评论 0原文

使用 Castle ActiveRecord 时,是否可以在运行时确定要使用哪个连接字符串?

据我了解,ActiveRecord 在应用程序的生命周期内只需初始化一次,这意味着必须在初始化之前配置数据库连接字符串。

但是,是否仍然可以在运行时确定连接字符串 - 即,如果 Web 应用程序直到用户登录后才知道要使用哪个数据库怎么办?

When using Castle ActiveRecord, is it possible to determine during runtime which connection string to use?

As I understand it, ActiveRecord has to be initialized only once during the application's lifetime and this means that database connection strings have to be configured prior to initialization.

However, is it still possible to determine connection strings during run time - i.e. what if the web app does not know which database to use until after the user has logged in?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文