views:

98

answers:

1

Hi

i've just started reading up on PLINQ and find it fasinating.

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

w://

A: 

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.

Mauricio Scheffer