Use this topic to learn how to enable resource routing in your environment.
A data source and connection factory can fail over and fail back automatically when a specified or default failure threshold value is reached. When fail over occurs, the application switches from using the primary resource to using the alternate resource. Fail back occurs when the application switches back from the alternate resource to the primary resource.
The alternate resource is created the same way that other connection factories or data sources are created. The alternate resource configuration should mirror the primary resource configuration. For example, the alternate resource security configuration and the primary resource configuration, with respect to the application and resources, should mirror each other so that the application and database can access the required data. After the alternate resource is created, you can change the database values that are necessary for the alternate resource backend configuration. If the alternate resource is not compatible, it is likely that fail over will fail. If the resources are not compatible, the following errors might occur: tables or fields that do not exist, an expected record does not exist and unexpected resource errors exist. As a test option, before the alternate resource is configured to the primary data source, you can test the application by changing the JNDI name in the application from the primary JNDI name to the alternate JNDI name.
When the primary resource is used, the alternate resource is paused. Before the alternate resource is paused, the alternate resource can be available before the primary is used. Using the alternate before it is paused is not recommended unless there is a special reason the alternate needs to be accessed before the primary resource. An example of a special reason is testing the application for compatability.
An alternate resource cannot be used as a primary. When using the fail over feature with non-relational resource adapters that have back-ends that also support fail over, you must verify that fail over is not configured for these back-ends. Fail over works with non-relational resource adapters that have a ManagedConnection object that implements a testConnection method. The testConnection method is used to ping the alternate and primary resources for success before re-establishing a connection to the currently available resource. If the resource adapter does not implement a testConnection method or testConnection throws a javax.resource.NotSupportedException error, the fail over feature is disabled.
For resource adapters that do not meet the requirement for testConnection, partial fail over can be used. You must manually fail back using Mbeans to the primary resource when the primary resource is available. Partial fail over can be enabled by setting the property, enablePartialResourceAdapterFailoverSupport to true.
You are encouraged to test the suitability of this feature with your system environment and resources before enabling fail over support.
For more information about using optimized local adapters, see the topic, Enabling optimized local adapter high availability support
Values: none, hold or automated; default is hold without automated fail back.
Description: Manual fail over to alternate resource. This action is issued on the primary resource.
Values: none, hold or automated; default is automated with automated fail over.
Description: Manual fail back to primary resource. This action is issued on the primary resource.
Values: boolean
Description: False - Disables resource fail over. True - Enables resource fail over. This action is issued on the primary resource.
Values: boolean
Description: False - Disables resource fail back. True - Enables resource fail back. This action is issued on the primary resource.
Values: boolean
Description: False - Disables populate alternate resource. True - Enables populate alternate resource. This action is issued on the alternate resource.
On the z/OS® platform, you can use some of the Mbean functionality by using the modify command. The modify command is used to manually disable resource failover support, enable resource failover support, failover to a configured alternate resource, and failback to the primary configured resource. See the topic, Modify Command, for more details on how to issue the command and to learn about the fail over parameters.
When action notification is configured for a particular resource and requests to that resource start to fail beyond a specified or default threshold value, the WebSphere® Application Server for z/OS run time receives notification to perform that particular action. The action is a configurable value. The action codes are defined in the failureNotificationActionCode property content located in the "Custom properties" section later in this topic.
An Action code 1 issues messages BBOJ0130I and BBOJ0131I to hardcopy in the controller region. These messages indicate that the resource for which this action was configured is unavailable and available respectively. WebSphere Application Server does not take any further automated action.
This action code stops and starts all applications with locally installed modules that use this resource for which this action was configured. Applications are stopped when the resource that these applications use is deemed unavailable. Applications are started when the resource that these applications use is deemed available.
Messages BBOJ0130I and BBOJ0131I contain the following information:
All properties for this feature must be created as new custom properties on the connection pool for a particular data source or connection factory. In the administrative console, navigate to the data source or connection factory that notification is to be enabled for. Click the Connection pool properties link. On the Pool Properties panel, click Connection pool custom properties link. The Custom properties panel for the resource connection pool displays. Click New to create the custom properties described as follows:
Values: {1,2,3}
Values: Must be an integer and > 0.
Description: The failureThreshold property is only read if the failureNotificationActionCode or alternateResourceJNDIName property is set to valid value. If the failureThreshold property is not set or is set to an invalid number the default value of 5 is used. The integer value specified for the failureThreshold is the number of consecutive resource exceptions that must occur for a particular resource before notification is sent or failover occurs.
Values: String value containing a direct JNDI name.
Description: An alternate connection factory or data source resource should be like the primary resource. Provide the JNDI name of the alternate resource to enable the fail over feature.
Values: int value, default is 10.
Description: The test connection interval by default is 10 seconds. Every 10 seconds, the test connection thread attempts to test the primary resource. Depending on system resources, this value can be change from 1 - MAXINIT seconds.
Values: boolean value, default is false.
Description: If this value is true, fail over to the alternate resource occurs, but fail back to the primary is manual. This property can be set if the resource adapter being used does not meet the requirements for connection fail over, for example, it does not have testConnection implemented or it throws a not supported exception.
Values: boolean value, default is false.
Description: If this value is true, automatic fail over does not occur.
Values: boolean value, default is false.
Description: If this value is true, automatic fail back does not occur.
Values: boolean value, default is false.