-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate and Oracle Cluster
PostPosted: Thu Jan 29, 2004 11:07 am 
Newbie

Joined: Thu Jan 29, 2004 10:52 am
Posts: 2
Hello,

Is there any limitation in using Hibernate with Oracle 9i RAC ?

The way we are willing to use Hibernate is through JBoss DataSources and Oracle OCI client.

Thanks for any feed-back

BB


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 11:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Hibernate is just like any other JDBC client, unless you enable the second-level cache, in which case it is just like any other JDBC client that has a cache.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 5:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please do not crosspost the forums, posting once is enough. I have answered in your other post here http://forum.hibernate.org/viewtopic.php?t=927502


Top
 Profile  
 
 Post subject: Oracle 10g RAC connection management with Hibernate
PostPosted: Mon Jun 13, 2005 1:23 pm 
Newbie

Joined: Mon Jun 13, 2005 1:13 pm
Posts: 1
I am not a developer, so please take it easy on me. We are implementing an Oracle 10.1.0.4 RAC cluster in the same timeframe that our application counterparts are moving to Hibernate from a home-grown solution.

The application teams involved would like to know if there is any special configuration or customization that will be required in order for Oracle connection pools managed by Hibernate to work properly during a failure. The connection string will handle load balancing, etc., but I assume that things like detecting failures, reaping dead connections, reconnecting (in a loop) after a failure, etc. would be managed by Hibernate. Is that true?

You can probably tell that I don't know exactly what I should be asking, but if anyone has experience using Hibernate and Oracle 10g RAC together, I would be interested in hearing about any problems or issues that have been identified.

Thanks in advance for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 11:53 pm 
Beginner
Beginner

Joined: Mon Jun 13, 2005 5:52 pm
Posts: 43
From the application's standpoint, AFAIK the JDBC driver abstracts all RAC aspects away from the application. The Java code could care less whether or not it is talking to one Oracle node or n nodes. I've been using this for months now with no application-level issues at the JDBC level. You'll just need to create a connect string that lists both nodes using the funky Oracle nested parenthesis format.

A variation of this works fine for me against 9iR2 RAC. I would think 10g works the same.

Code:
jdbc:oracle:thin:@(description=(address_list=(address=(host=node1)(protocol=tcp)(port=1521))(address=(host=node2)(protocol=tcp)(port=1521))(load_balance=yes)(failover=yes))(connect_data=(service_name=orcl)))


On the flip side, the DBA shouldn't be too concerned about the SQL Hibernate generates. Mostly its just doing "keyed reads" against the database tables. You can enable logging for all SQL Hibernate generates, so if you want to check certain statements for performance, you'll have access to all database interactions. I recommend using something that will autoformat SQL (e.g. Toad).

By the way, does anyone know of any good SQL formatters that are free?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 3:15 pm 
Newbie

Joined: Tue Jun 14, 2005 2:44 pm
Posts: 1
We currently have an Oracle 9i database and are primarily using DAO's to access the database using connection pools set up on our Websphere application servers. We've recently started switching our strategy to use Hibernate for all the benefits it provides and have already switched many of our objects to use this.

Now, due to the need to scale out, we are planning on going to 10g and implementing RAC. I'm just coming up to speed on this as well, but I know there are code changes required around inserts, updates and deletes in order to catch errors received by one of the nodes going down and retry those queries on another node.

My question is similar to sandeaj's in that I want to know if Hibernate can be configured to know about RAC and automatically take care of wrapping the SQL to be aware of the error and retry the statement without any manual changes by the developer. If not, is anyone come up with a good way to implement automatic transaction failover with Hibernate in a generic way? Samples would be helpful.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 10:32 pm 
Beginner
Beginner

Joined: Mon Jun 13, 2005 5:52 pm
Posts: 43
I think that the transparent application failover (TAF) only works with the OCI drivers--keep that in mind. There's two different levels you can adopt, if I understand correctly (although I may have this wrong). One level is session failover, where the connection won't be dropped if one node shuts down. Any open cursors are terminated along with the transaction, but the connection remains open. The other type is cursor level, which lets you resume an existing select statement.

It appears that the JDBC driver handles TAF for you, if possible. Take a look at the sample app at:

http://www.oracle.com/technology/sample ... eadme.html

The QueryThread.java class looks like it is just using plain-ol JDBC. Since Hibernate just uses plain JDBC, I'm assuming TAF would work fine with Hibernate.

Keep in mind that this is not a silver bullet--your uncommitted inserts/updates/deletes will roll back if the node goes down. See:

I hope this helps. Post your findings to this thread so others can benefit. Likewise, I'll give this a try on my cluster.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 14, 2005 10:34 pm 
Beginner
Beginner

Joined: Mon Jun 13, 2005 5:52 pm
Posts: 43
It would help if I pasted the other URL :-)

http://www.remote-dba.cc/10g_10_1.htm


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