Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚开始阅读 PLINQ 并发现它很吸引人。
我在我的项目中使用 NHib->Linq - 有谁知道使用 NHLinq 的 PLINQ 类型查询是否有任何好处/问题?
w://
如果您尝试使用 PLINQ 并行化多个 NHibernate 查询,请记住 NHibernate 的 ISession 不是线程安全的。您必须为 PLINQ 循环的每个步骤使用一个新的 ISession,因为每个步骤都可能在另一个线程中运行。
如果您尝试在单个 NHibernate 查询中使用 PLINQ 构造,充其量您会得到一个异常,因为 SQL 本身没有任何并行构造。