-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Case sensitivity when using Oracle database
PostPosted: Mon Sep 22, 2008 8:56 am 
Newbie

Joined: Mon Sep 22, 2008 8:33 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2008 8:32 am 
Newbie

Joined: Mon Sep 22, 2008 8:33 am
Posts: 2
Ok,

I am not sure if it is the best (or correct) way, but I have overriden the IDbConnection GetConnection() method of DriverConnectionProvider and configured the NHibernate to use it.

Regards,
David


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.