I wanted to implemented the new NHibernate Validators which meant upgrading to NH 2.1. Found a great post documenting the new “breaking change” between 2.0 and 2.1 pertaining to the new proxy factory functionality in NH. “The ProxyFactoryFactory was not configured.” jumped up and bit me in the ass.
NH used to assume Castle – but now it needs to be configured. In addition to the Castly proxy, there is a new LinFu proxy available too. Don’t bother with NHibernate the release notes! , Davy Brion has it all for you here =).
I opted to go with the Castly Dynamic Proxy – I’m not in a position to do any performance tests between– Castle has been around a long time and has a pretty big user base. Good post on stackoverflow on this subject. However, LinFu would have won if I was basing my choice on name alone…
After a bit of fiddling, I’m back up and running with NH 2.1 and shiny new validation attributes.
For my future reference!
RADE and FullCircle and builds usually have the ODP.NET version in the web.confg set by the installer, but development builds usually come from my machine and are configured for use with the Oracle 11 ODP.NET. If this is set incorrectly, you will get an error that looks a little something like this:
The IDbCommand and IDbConnection implementation in the assembly Oracle.DataAccess could not be found. Ensure that the assembly Oracle.DataAccess is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
To use an different version of the Oracle client, the web.config must be edited and the QualifyAssembly section must have its version property set appropriately. This will also apply for an app.config too.
2: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
3: <qualifyAssembly partialName="Oracle.DataAccess" fullName="Oracle.DataAccess, Version=18.104.22.168, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
Possible values for this are:
- 11g: Version=22.214.171.124
- 10g R2: Version=126.96.36.199
- 10g: Version=10.2.0.100
Set your config appropriately and you’re good to go.