Hello,
first of all, let me say thanks to everyone contributing to NHibernate. I am using it for about three years now and I am very happy with it.
Now the question: I am using Oracle as the database for the current project. The problem is that string comparisons in the database are case sensitive - and the administrator of the database cannot change it. We are developing on the Express Edition but the application will run on the "Big Oracle" when finished. NHibernate version is 1.2.
I need to find a way how to make the comparisons case insensitive when running my application, globally.
What I have found is that ODP.NET for Oracle allows me to run the following code to achieve what I need:
Code:
m_Connection = <active database connection>;
OracleGlobalization sessionGlobalization = m_Connection.GetSessionInfo();
sessionGlobalization.Sort = "binary_ci";
sessionGlobalization.Comparison = "linguistic";
m_Connection.SetSessionInfo(sessionGlobalization);
The problem is that that it requires the connection to be opened to run the code. I am trying to find a way how to execute the code everytime after NHibernate establish a connection to the database.
Please can you advise me how can I do that (easily), or give me some tip how to achieve global case insensitivity by the another way?
Thank you very much!
Regards, David