-->
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: Issue with using ODP with NHibernate
PostPosted: Tue Jun 22, 2010 4:04 am 
Newbie

Joined: Tue Jun 22, 2010 3:57 am
Posts: 2
Hello, I have .NET 3.5 application wrote in C# using NHibernate.
Before I has OracleClientDriver in connection.driver_class property, that say that I use System.Data.Oracle and all works fine, but for some reasons now I need using ODP, so I changed this property to: NHibernate.Driver.OracleDataClientDriver.
When I run my code I get following error during Session Factory creation:

Code:
Unable to cast object of type 'Oracle.DataAccess.Client.OracleConnection' to type 'System.Data.Common.DbConnection'

After short searching in Inernet I found solution: to add:

Code:
<property name="hbm2ddl.keywords">none</property>

So now NHibernate successfully build Session Factory but fall in session.Flush() with following error:

Code:
System.ArgumentException: Value does not fall within the expected range
at Oracle.DataAccess.Client.OracleParameter.set_DbType(DbType value)
at NHibernate.Driver.DriverBase.InitializeParameter(IDbDataParameter dbParam, String name, SqlTypes sqlType)


Any ideas?
Thank you for ahead. But this give me following

And some thing else: I need to talk with one of web administrators. If you are web administrator I will very glad if you will send mail to: rodnower@gmail.com or to mail with one I registered (first is prefer).


Top
 Profile  
 
 Post subject: Re: Issue with using ODP with NHibernate
PostPosted: Tue Jun 22, 2010 4:43 pm 
Newbie

Joined: Tue Jun 22, 2010 3:57 am
Posts: 2
I win!
So what I did before:
I get Oracle.DataAccess.dll from Oracle Client bin directory and referenced it from my project assembly. When I run NHibernate Configure() function I get first error. When I removed the reference I get error that says that I need to use qalifyAssembly element in app.config for reference GAC Oracle.DataAccess.dll.

So what I did to resolve it:
I went to GAC and compare versions of Oracle.DataAccess dlls there with one I referenced before. It was: version of that that I recently referenced was: 10.x.x.x and version of dll in GAC (actualy there were number of DataAccess dlls) was 2.x.x.x. Here:
http://tiredblogger.wordpress.com/2008/ ... s-library/
I found error similar to my, and I added this code
Code:
<runtime>
       <assemblyBinding xmlns=“urn:schemas-microsoft-com:asm.v1“>
              <qualifyAssembly partialName=“Oracle.DataAccess“
                     fullName=“Oracle.DataAccess,
                            Version=2.111.6.20,
                           Culture=neutral,
                           PublicKeyToken=89b483f429c47342“ />
       </assemblyBinding>
</runtime>

to app.config like described in above link and all works!!!

But I still need web admin send me a mail.


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.