-->
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.  [ 4 posts ] 
Author Message
 Post subject: hibernate and oracle RAC
PostPosted: Wed Apr 19, 2006 10:52 am 
Newbie

Joined: Wed Apr 19, 2006 10:35 am
Posts: 1
I'm using hibernate 3.0 and oracle DB 10g R2 in a RAC architecture.

in order to enable the FCF (fast connection failover), oracle suggests to use the following code in a classic JDBC application:

OracleDataSource ods = new OracleDataSource()
ods.setUser("Scott");
...
ods.setPassword("tiger");
ods.setConnectionCachingEnabled(True);
ods.setFastConnectionFailoverEnabled(True);
ods.setConnectionCacheName("MyCache");
ods.setConnectionCacheProperties(cp);
ods.setURL("jdbc:oracle:thin:@(DESCRIPTION=
(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=VIP1)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=VIP2)(PORT=1521))
(CONNECT_DATA=(service_name=service_name)))");

As I'm using hibernate I can't use this code.

I think I can configure my application in the following way:

hibernate.dialect=org.hibernate.dialect.OracleDialect
hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.connection.username=xyz
hibernate.connection.password=abc
hibernate.connection.url=jdbc:oracle:thin:@(DESCRIPTION=
(LOAD_BALANCE=on)(FAILOVER=on)
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=host1)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=app1)))
hibernate.connection.pool_size=1
hibernate.show_sql=true


My questions are:

1. is hibernate fully compatible with oracle RAC ?
2. is my hibernate configuration (see code above) valid ?
3. are ods.setFastConnectionFailoverEnabled(True); AND (FAILOVER=on)
equivalent ?
4. what is the equivalent of ods.setConnectionCachingEnabled(True);
in the hibernate configuration ?

Thank's for your help


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 12, 2006 12:12 pm 
Newbie

Joined: Fri Apr 28, 2006 10:14 am
Posts: 11
Location: Paris, France
I'm researching this, it'd be nice to have a reply on this topic for both me and anyone else searching the archives..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 12, 2006 12:25 pm 
Newbie

Joined: Fri Apr 28, 2006 10:14 am
Posts: 11
Location: Paris, France
see http://forum.hibernate.org/viewtopic.php?t=927501&highlight=oracle+rac


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 2:14 am 
Newbie

Joined: Sat Mar 31, 2007 2:10 am
Posts: 3
I am researching this problem too. The main issue is how to do the retry. If you want to enable the FCF feature, you need to take the retry action, otherwise make no sense. How to make Hibernate detect the Oracle exception and do the retry automatically? What about use them together with Spring? Does anyone has a better solution?


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