使用 Spring.NET 配置 NThibnerate SQL 字符串缓存
使用内存分析工具,NHibnerate 看起来会在执行时缓存 SQL 字符串,这些字符串占用大量内存空间。
Spring.NET是否可以配置缓存相关的设置?
谢谢。
With memory profiling tools, it looks like NHibnerate will cache SQL strings while execution, which occupy a large # of memory spaces.
Whether Spring.NET is able to configure the cache-related setting?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring.NET 不提供对特定 NHibernate 行为的任何(直接)控制,但由于 Spring.NET 允许访问所有底层 NHibernate 设置,如果在 NHibernate 中有控制此行为的“本机”方法,则传递此配置完全支持使用 Spring.NET 时将值设置为 NH。
有关详细信息,请参阅 http:// www.springframework.net/doc-latest/reference/html/orm.html#orm-session-factory-setup 并通过添加字典条目来仔细研究设置 NH 属性的模式,如代码示例中所示。这种方法允许访问任何和所有底层“本机”NHibernate 设置,您在将 NH 与 Spring.NET 结合使用时可能需要控制/配置这些设置。
Spring.NET doesn't provide any (direct) control of that specific NHibernate behavior, but since Spring.NET permits access to all underlying NHibernate settings, if there is a 'native' way to control this behavior in NHibernate, then passing this config value to NH when using Spring.NET is entirely supported.
For more info, see http://www.springframework.net/doc-latest/reference/html/orm.html#orm-session-factory-setup and investigate closely the pattern of setting NH properties by adding dictionary entries as demonstrated in the code sample. This approach permits access to any and all underlying 'native' NHibernate settings that you may need to control/configure when using NH with Spring.NET.