Castle ActiveRecord - 在运行时确定连接字符串
使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看不同DatabaseScope
Check out DifferentDatabaseScope