-->
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.  [ 3 posts ] 
Author Message
 Post subject: Connection to Oracle server rack
PostPosted: Fri Mar 28, 2008 8:23 am 
Newbie

Joined: Fri Mar 28, 2008 8:04 am
Posts: 2
Hi guys

I'm trying to connect to a server rack of Oracle 10g (v 10.2.0.3) using NHibernate. My entry in tnsnames.ora looks something like this:

TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rack1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rack2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rack3)(PORT = 1521))
(LOAD_BALANCE = yes)
(FAILOVER = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = my_service)
)
)

Does anyone know how to specify the connection_string in the hibernate.config? Is it something like this:

<property name="connection.connection_string">Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rack1,rack2,rack3)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=my_service)));User Id=u;Password=p;</property>

//Lis


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 28, 2008 8:52 am 
Senior
Senior

Joined: Thu Jun 21, 2007 8:03 am
Posts: 127
Location: UK
Hi Lis,

You didn't mention which version of NHibernate you are using, but I'll assume it's 1.2.

In addition, if your tnsnames.ora has that definition, then I suspect you can refer to 'TEST' directly in the connection string (i.e., you can type tnsping TEST, and it works ok).

An example config file might look like:
Code:
<configuration>

    <configSections>
        <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    </configSections>

    <nhibernate>
        <add key="hibernate.connection.provider"            value="NHibernate.Connection.DriverConnectionProvider"/>
        <add key="hibernate.dialect"                        value="NHibernate.Dialect.OracleDialect"/>
        <add key="hibernate.connection.driver_class"        value="NHibernate.Driver.OracleClientDriver"/>
        <add key="hibernate.connection.connection_string"   value="Data Source=TEST;User Id=u;Password=p;"/>
    </nhibernate>

</configuration>


Regards,
Richard


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 28, 2008 11:17 am 
Newbie

Joined: Fri Mar 28, 2008 8:04 am
Posts: 2
Hi Richard

You are absolutley correct, I'm using NHibernate version 1.2. I will try your suggestion next week at the customer (that's why I didn't use the trial and error method).

Will let you all know if it worked as soon as I can, but it seems to me like it would.

Thanks for your swift reply!

regards,
Lis


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.