Home » Developer & Programmer » JDeveloper, Java & XML » OracleFailoverEventHandler vs OracleHAEventHandler (Oracle ODAC Client, window server 2003 )
OracleFailoverEventHandler vs OracleHAEventHandler [message #472432] Fri, 20 August 2010 09:14
Messages: 21
Registered: June 2008
Location: LONDON
Junior Member
Hello There !
I have recently Implemented Oracle 11gR2 RAC Two node environment in our organization.

Now I am confused about both this term.I dont understand what would I use for my TAF CALLBACK HIGHLY AVAIBILITY.

I have gone through documentation as well but still not cleared my concept.

here is bit part of my code !!
		 * This method is FailOver Callback method called when the 
		 * connection to the database is severed. It is called several 
		 * times in the process of re-establishing connection to the 
		 * same or standby database.
		public FailoverReturnCode OnFailover(object sender, OracleFailoverEventArgs eventArgs)
		// check the Failover event that occurred and display appropriate message
            // when failover begins
			case FailoverEvent.Begin:
				MessageBox.Show("Callback method called :Failover Begin");
				lblStatus.Text="Callback method called :Failover Begin. Trying to reconnect, Please wait...";
            // when failover is aborted
			case FailoverEvent.Abort:
				MessageBox.Show("Callback method called :Failover Aborted");
                lblStatus.Text="Callback method called :Failover Aborted";
            // when failover is complete
			case FailoverEvent.End:
				MessageBox.Show("Callback method called :Failover End");
				// call method to set session information on re-established
				// connection
				lblStatus.Text="Callback method called :Failover End";
            //when error occurs while reconnecting
			case FailoverEvent.Error:
				lblStatus.Text="Failover Error -Sleeping and Retrying to connect to database. Please wait... ";
				//check to do form Refresh only once
				return FailoverReturnCode.Retry;
            // when reautentication is required during Failover 
			case FailoverEvent.Reauth:
				MessageBox.Show("Callback method called :Failover reauthenticating");
				lblStatus.Text="Callback method called :Failover reauthenticating";
				MessageBox.Show("Bad Failover");
				lblStatus.Text="Bad Failover";
		return FailoverReturnCode.Success;

	   * The purpose of this method is to get the database connection 
	   * using the parameters given in ConnectionParams.cs.
	   * The connection parameter enlist is set to false for the TAF to
	   * work properly.
	   * Note: Replace the datasource parameter with your datasource value
	   * in ConnectionParams.cs file.
		private Boolean getDBConnection()
				lblStatus.Text="Connecting to database";
				//Connection Information        
				string connectionString = 
					"User Id=" + ConnectionParams.Username +

					";Password=" + ConnectionParams.Password +
					//set enlist parameter to false. Required for TAF
					";enlist=false" +

					//replace with your datasource value (TNSnames)
					";Data Source=" + ConnectionParams.Datasource;

				//Connection to datasource, using connection parameters given above
				conn = new OracleConnection(connectionString);
				//Open database connection

				lblStatus.Text="Connected to the database. Click 'Get Products Data' to fetch products data ";
				// alter date format for the session 
				conn.Failover += new OracleFailoverEventHandler(OnFailover);
				return true;
				// catch exception when error in connecting to database occurs
			catch (Exception ex) 
				//Display error message
				return false;

Can anybody explain me more or send me link which give me whole idea about Failover vs HA in ODAC.

Many THanks !
Previous Topic: ORA-29532 when using Callablestatement.execute()
Next Topic: How to map java objects to Oracle datatypes
Goto Forum:

Current Time: Wed Dec 02 01:57:10 CST 2015

Total time taken to generate the page: 0.16409 seconds