Pages

Wednesday, April 10, 2019

JDBC Tips

JDBC Tips


JDBC related issues in your WebLogic Environment the Please Keep the following tips always in mind.

1) Set the Maximum Capacity of the connection pool at least equal to the Execute Thread Count.

2) Configure Inactive Connection Timeout to specify how long (in seconds) a connection can be inactive before it is reclaimed to the pool.

3) The connection leak profiling option shows leaked connections from the connection pool. BEA recommends that you do not use this option in production; it uses extra resources and typically slows connectionpool operations.

4) If possible, size database connection pools so that they never increase the number of connections: set Initial Capacity equal to Maximum Capacity.

5) Use Test Reserved Connections only if you can afford the overhead of testing connections as part of normal request processing.

6) Avoid using a production table for “Test Table Name”, use a dummy table (ex. dual).

7) Use the statement cache to improve performance of prepared and callable statements.

8) Select the least-recently-used (LRU) algorithm for the cache; this removes rarely-used statements from the cache.

9) Connection Creation Retry Frequency can be used to retry for establishing connections to the database, if database is not reachable when creating connection pool or starting WebLogic Server.

10) If database is restarted when WebLogic Server is running, Test Frequency can be increased from 0, so that all the connections are closed and reopened to re-establish valid physical connection. After all the connections are recreated changing it back to 0 will disable the testing.

11) When using DataSource objects for a connection pool, use the Honors Global Transaction option to create a TxDataSource.

12) The only time you should use a non-Tx Data Source is when you want to do some work on the database that you do not want to include in the current transaction.

13) When configuring a connection pool to use with WebLogic JMS JDBC Store, use non-XA database drivers.

No comments:

Post a Comment