Databases Reference
In-Depth Information
How it works...
This recipe changes a GridLink data source but this can work for Generic data source types
as well.
During the WebLogic Server startup process, the data sources are deployed and the
connections to the databases are opened according to the Initial Capacity parameter.
If a data source connection cannot be established with the database during startup for some
reason, the Managed Server starts in the ADMIN state instead of in the RUNNING state.
The commonly used procedure in this situation is to click on the Resume button; the server
instance resumes to the RUNNING state and starts accepting and processing the application
requests. However, the data source remains undeployed and uninitialized, and errors will
occur with the applications that use this data source. Even if the database goes back online,
the data source will not start automatically.
To avoid the ADMIN state on startup, set the data source Initial Capacity to
0 so it won't open any connection to the database during the server startup
process. The Managed Server instance will start in the RUNNING state, and
as soon as the database goes back online, the data source will reconnect to it
without intervention.
The drawback is that since WebLogic will start in the RUNNING state, even with the database
out, the application requests that use the data source will return errors. Therefore, it is a good
idea to use the option that best suits the application's requirements.
It's also a common recommendation to set Initial Capacity and Maximum Capacity to the
same value so all connections would already be open when needed. The value of 15 for
Maximum Capacity was used as an example.
In WebLogic Server 12 c , a better recommendation for production
environments would be to set Initial Capacity to 0 and Minimum Capacity
and Maximum Capacity to the same value. The Minimum Capacity
parameter was added in WebLogic Server 10.3.6.
With the Test Connection on Reserve option enabled, WebLogic tests the connection with
the database using the query specified in the Test Table Name field, just before lending
the connection to the application. The value of 0 seconds in the Seconds to Trust an Idle
Connection field forces the test to be made in every request. The Test Frequency field was
also increased to 900 seconds instead of the default value of 120 seconds.
 
Search WWH ::




Custom Search