We have a pair of clustered Oracle8i databases and I was wondering if anyone has any best-practice ideas for establishing connections to them. In Orion or Oracle9i app server, you define datasources that are added to a JNDI registry, and that works with no problem. However, what's the best way to support load balancing and failover with this set up? I'm figuring that this has to be done programmatically (wrapper classes that pick a server to connect to), but I was wondering if anyone had ideas or examples of how they handle something like this?
Thanks in advance!
- First, I suppose you mean 8i OPS !
- In fact thick Oracle's 8i and 9i JDBC/OCI drivers perform loadbalancing/failover in a transparent manner (the network conf is a bit different)
BTW be careful of the three points :
- 8i OPS is not 9i RAC (It is not only about marketing)... You may encounter lack of performance if you loadbalance connections on a 8i, due to write/write contention. You can handle this programmatically by configuring 2 pools of connection accessing different sets of data, each connected on a different instance... This point is solved with 9i RAC.
- You may encouter an SQL ERROR (in case of an instance crash) asking you to rollback your transaction because the system is not able to do the commit ! You'll have to handle this error; BUT it is not a OPS/RAC specific error ! this kind of error happens if a tablespace is full : the system is not able to commit your transaction.
REDO the transaction will then solve the problem.
- Failover works definitly well with 9i AND 8i
Hope it will help !
thanks for the info gregory, but i have some bad news.
okay i talked the dbadmin and we are running standard edition that does not have OPS mode available... Basically, this cluster is just for 'replication', but we would like to know how to support failover and load balancing. I'm thinking we're going to have to register both servers as datasources and then write wrapper classes that will determine which datasource to use. other than that, i dunno what we can do :(