PersistanceConfiguration for Oracle/Fluent NHibernate
On Tuesday, I mentioned that I created a custom PersistanceConfiguration (based on the template for MS SQL) to connect to Oracle. I had a few individuals email me, so I went ahead and tossed the code out on Google Code for everyone.
Feel free to download the source here.
The class derives FluentNHibernate’s PersistanceConfiguration<T> and uses the Oracle.DataAccess (ODP) driver.
To use it, run through just like the MS SQL version. I did, however, add an OtherOptions property to pass caching, pooling, and other Oracle-specific parameters. I could have put each to a separate property (and may in the future)—as soon as I can get F-NHibernate fully working. Heh. Priorities, right?
// Add our Oracle configuration to the NHibernate Config.
var oracleConfiguration = OracleConfiguration.Oracle9
.OtherOptions(“Statement Cache Size=50;”)