Oracle client

61 views
Skip to first unread message
Message has been deleted

Sheraz

unread,
May 6, 2008, 1:20:12 PM5/6/08
to nhusers
Hi guys,
I am using NHibernate with oracle and I get the following
exception
when I run the project on client

System.Exception: System.Data.OracleClient requires Oracle client
softwa
re version 8.1.7 or greater.


here is my configuration. Does that mean that the oracle client has
to
be installed in order to use it??????


<property
name="connection.provider">NHibernate.Connection.DriverConnectionProvider</
property>
<!-- Oracle 9i and 10g use the same dialect -->
<property name="dialect">NHibernate.Dialect.Oracle9Dialect</
property>
<!-- use the client from Oracle (ODP.NET)
NHibernate.Driver.OracleDataClientDriver as opposed to
NHibernate.Driver.OracleClientDriver -->


<property
name="connection.driver_class">NHibernate.Driver.OracleClientDriver</
property>
<property name="connection.connection_string">User Id = userid;
Data source = somesource; Password =
somepwd;</property>
<property name="connection.isolation">ReadCommitted</property>


Sheraz

unread,
May 6, 2008, 2:09:24 PM5/6/08
to nhusers
this is the actual error I get
"System.Data.OracleClient.OracleException: ORA-06401: NETCMN: invalid
driver designator"

Any clue why is that happening !!!!!

James Kovacs

unread,
May 6, 2008, 2:21:06 PM5/6/08
to nhu...@googlegroups.com
Yes, the Oracle client must be installed. NHibernate uses ADO.NET under the covers and ADO.NET requires the Oracle client driver to be installed.

James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - C# Architecture
http://www.jameskovacs.com
jko...@post.harvard.edu
403-397-3177 (mobile)

Sheraz

unread,
May 6, 2008, 2:22:39 PM5/6/08
to nhusers
what if I use NHibernate.Driver.OracleDataClientDriver, even then I'd
need to install the client????

On May 6, 2:21 pm, "James Kovacs" <jkov...@post.harvard.edu> wrote:
> Yes, the Oracle client must be installed. NHibernate uses ADO.NET under the
> covers and ADO.NET requires the Oracle client driver to be installed.
>
> James
> --
> James Kovacs, B.Sc., M.Sc., MCSD, MCT
> Microsoft MVP - C# Architecturehttp://www.jameskovacs.com
> jkov...@post.harvard.edu
> >     <property name="connection.isolation">ReadCommitted</property>- Hide quoted text -
>
> - Show quoted text -

Ben Scheirman

unread,
May 6, 2008, 2:31:33 PM5/6/08
to nhu...@googlegroups.com
Yes.  My understanding is that that OracleDataClientDriver is the one that's pointing to the Oracle client libraries.

James Kovacs

unread,
May 6, 2008, 2:34:12 PM5/6/08
to nhu...@googlegroups.com
I've used both OracleDataClientDriver (from Oracle) and OracleClient (from Microsoft). In both cases they required the unmanaged Oracle Client Libraries to be installed for them to function properly.


James
--
James Kovacs, B.Sc., M.Sc., MCSD, MCT
Microsoft MVP - C# Architecture
http://www.jameskovacs.com
jko...@post.harvard.edu
403-397-3177 (mobile)

Sheraz

unread,
May 6, 2008, 2:38:46 PM5/6/08
to nhusers
So then is there any way to connect to oracle without going thru the
installation of oracle client???? what if we use oledb or odbc??????
> > > - Show quoted text -- Hide quoted text -

Tuna Toksöz

unread,
May 6, 2008, 2:43:02 PM5/6/08
to nhu...@googlegroups.com
My thinking is it would result in performance loss, but not sure.
--
Tuna Toksöz

Typos included to enhance the reader's attention ...

Ben Scheirman

unread,
May 6, 2008, 2:55:10 PM5/6/08
to nhu...@googlegroups.com
Yeah don't use ODBC.  The Oracle provider is a lot faster than the .NET Oracle provider.

I haven't used Oracle since college, but I do remember the install pain.

Sheraz

unread,
May 6, 2008, 2:58:25 PM5/6/08
to nhusers
@Ben: are you saying that I can use OLEDB to connect to oracle without
installing oracle client????

On May 6, 2:55 pm, "Ben Scheirman" <subdigi...@gmail.com> wrote:
> Yeah don't use ODBC.  The Oracle provider is a lot faster than the .NET
> Oracle provider.
>
> I haven't used Oracle since college, but I do remember the install pain.
>
>
>
> On Tue, May 6, 2008 at 1:43 PM, Tuna Toksöz <tehl...@gmail.com> wrote:
> > My thinking is it would result in performance loss, but not sure.
>
> > Typos included to enhance the reader's attention ...- Hide quoted text -

Filip Kinsky

unread,
May 7, 2008, 6:01:33 AM5/7/08
to nhusers
The most simple setup is to use Oracle Instant Client + Oracle Data
Access Components. You can find both on oracle.com. You don't even
have to run any installer - just extract the files from ZIP and setup
the PATH env variable...

Sheraz

unread,
May 7, 2008, 1:00:47 PM5/7/08
to nhusers
Filip@ I have been trying to do exactly what you said. I downloaded
Oracle Instant Client for Microsoft Windows 11 g the lite version (we
have 9i running on server thou). Then I copied the dlls of instant
clent into the bin directory of application. Added reference of
System.Data.OracleClient. Even thou i have copied the instant cleint
dlls in the bin folder, I don't need to set the path variable but
regarless I did it.
After doing all that I get "System.Exception: OCIEnvCreate
failed with return code -1".
Any clue why is that happening?????

Nazareno

unread,
May 7, 2008, 12:07:00 PM5/7/08
to nhusers

Sheraz

unread,
May 7, 2008, 4:02:27 PM5/7/08
to nhusers
Nazareno@ I don't have problem with connectivity. The problem is that
in order to make app work on the client, we need to install oracle
client. We can't do it becasue of security reason. So the solution I"m
looking for is to be able to make the client connect the server
without any installation requied. If I use Oracle.DataAccess, I get
connected thru my matchine but it's becasue I have the Oracle Data
Access Components installed on my machine.

On May 7, 12:07 pm, Nazareno <nazar...@libero.it> wrote:
> Hello,
>
>   check the thread
>
> http://groups.google.com/group/nhusers/browse_thread/thread/d4680f95b...
>
> Bye
> Nazareno

Ayende Rahien

unread,
May 7, 2008, 4:04:54 PM5/7/08
to nhu...@googlegroups.com
If you can access Oracle using IDbconnection, NH would be able to work with it.
But if you can't, there isn't much NH can do.
You are better off taking this to the ORA forum

Filip Kinsky

unread,
May 8, 2008, 2:15:47 AM5/8/08
to nhusers
You don't mention the Oracle Data Access Components (ODAC) - did you
use it beside instant client? It contains some dll libraries plus
ADO.Net provider in Oracle.DataAccess.dll assembly which you should
use instead of System.Data.OracleClient. I use exactly this setup with
following NH config params and I don't have any problem with
connection to Oracle. If you'd like to copy also the ODAC libraries
into you application bin directory just copy these files from ODAC zip
archive (plus the provider assembly of course):

isqlplus.dll
oci.dll
ociw32.dll
orannzsbb10.dll
oraociei10.dll
OraOps11.dll
OraOps11w.dll
Orasqlplusic10.dll
oravs11w.dll
oravsdbgeng11w.dll
OraVsDBProject11w.dll
oravsjdwp11w.dll
oravslangsvc11w.dll
oravspls11w.dll
oravsproject11w.dll
oravssql11w.dll

NH config params:
<add key="connection.driver_class"
value="NHibernate.Driver.OracleDataClientDriver"/>
<add key="dialect" value="NHibernate.Dialect.OracleDialect"/>

The only downside is that the ODAC libraries are really monstrous -
it's some 120MB :/

Sheraz

unread,
May 8, 2008, 1:45:04 PM5/8/08
to nhusers
To All,
So based on this post, what I came across so far is that most
of developers think that in order to connect to oracle, you need
oracle client installed. This is not correct as I just across this
issue where we couldn't install anything on client becasue of security
reasons.
So now I'm gonna share this knowledge so that you guys won't have
to go thru the trouble I had to.
1 - Download the Oracle Instant Clent (you only need the lite version)
and extract it somewhere
http://www.oracle.com/technology/software/htdocs/client_lic.html?url=http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html

2 - You have two options. You can either user System.Data.OracleCleint
or Oracle.DataAccess. I am using System.Data.OracleCleint. So to use
System.Data.OracleClient, define your configuration like this
<property
name="connection.driver_class">NHibernate.Driver.OracleClientDriver</
property>

3 - Copy the following files from the oracle instant client direction
you downloaded where your executable file is
oci.dll
orannzsbb11.dll
oraocci11.dll
oraociicus11.dll

4 - Add a new file named Oracle.Key and add this in that file
SOFTWARE\ORACLE\KEY_OraOdac11g_home2

That's it. You are all set. Remember that I'm using
system.Data.OracleCleint not Oracle.DataAccess.
Hope this helps.
Reply all
Reply to author
Forward
0 new messages