开发者

NHibernate LINQ + PLINQ

开发者 https://www.devze.com 2022-12-29 03:33 出处:网络
i\'ve just started reading up on PLINQ and find it fas开发者_JS百科inating. I\'m using NHib->Linq in my projects - does anyone know if there\'s any benefit/problems using PLINQ type queries with NHLi

i've just started reading up on PLINQ and find it fas开发者_JS百科inating.

I'm using NHib->Linq in my projects - does anyone know if there's any benefit/problems using PLINQ type queries with NHLinq?

w://


If you're trying to parallelize several NHibernate queries with PLINQ, keep in mind that NHibernate's ISession is not thread-safe. You have to use a new ISession for each step of the PLINQ loop, since each step can potentially run in another thread.

If you're trying to use PLINQ constructs within a single NHibernate query at best you'll get an exception since SQL itself does not have any parallelizing constructs.

0

精彩评论

暂无评论...
验证码 换一张
取 消