NHibernate – SQL2005 Dialect

I had a random error happening the other day when I was running an NHibernate based app I was working on – the problem was the error (“Unable to perform find”) would only happen every now and it wasnt consistantly occurring in the same place. After a bit of digging I read a few other people where having similar issues – running on Sql2005 – something to do with the way 2k5 works with returning rows in certain block sizes… anyway I grabbed the Sql2005 dialect, compiled a dll and chucked it in – as I said the errors seemed to be sparatic… hopefully its fixed now but if anyone else is having the same problem then maybe give this a shot 🙂

 I originally got the dialect file off a link from Ayende Rahien’s blog: http://www.ayende.com/

I can’t find it now but I’m sure google might show you some love 🙂 If not then flick me an email and I’ll send you a copy…

In the config file you need to change the dialect setting:

<add key=”hibernate.dialect” value=”NHibernate.Dialect.Extension.MsSql2005Dialect, NHibernate.Dialect.Extension” />

Note the fully qualified class name and then the assembly name (the assembly you compile containing the new dialect will need to be referenced in the project or signed and placed in the gac) 🙂


One Response to “NHibernate – SQL2005 Dialect”

  1. rajiv Says:

    The dialect is here:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: