Skip to content

Commit 5612152

Browse files
Merge pull request #5516 from BimsaraBodaragama/fix-4145/recomended-db-props
2 parents 85a7de6 + 6608b22 commit 5612152

File tree

54 files changed

+1017
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1017
-28
lines changed

en/identity-server/5.10.0/docs/setup/changing-to-ibm-db2.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,31 @@ The elements in the above configuration are described below:
281281
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
282282

283283

284-
284+
## Driver-Level Timeouts (Recommended for Production)
285+
286+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
287+
288+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
289+
290+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
291+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
292+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
293+
294+
Also note the distinction:
295+
296+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
297+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
298+
299+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
300+
301+
### Example: IBM DB2 database
302+
303+
```toml
304+
[database.identity_db]
305+
url = "jdbc:db2://DB_HOST:50000/WSO2_IDENTITY_DB:loginTimeout=10;queryTimeout=60;"
306+
username = "..."
307+
password = "..."
308+
driver = "com.ibm.db2.jcc.DB2Driver"
309+
```
310+
311+
Learn more in [IBM DB2 connection settings](https://www.ibm.com/docs/en/db2/11.5?topic=client-jdbc-properties){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-mssql.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,31 @@ The elements in the above configuration are described below:
269269
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
270270

271271

272-
272+
## Driver-Level Timeouts (Recommended for Production)
273+
274+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
275+
276+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
277+
278+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
279+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
280+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
281+
282+
Also note the distinction:
283+
284+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
285+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
286+
287+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
288+
289+
### Example: MSSQL database
290+
291+
```toml
292+
[database.identity_db]
293+
url = "jdbc:sqlserver://DB_HOST:1433;databaseName=WSO2_IDENTITY_DB;loginTimeout=10;socketTimeout=60000"
294+
username = "..."
295+
password = "..."
296+
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
297+
```
298+
299+
Learn more in [Microsoft JDBC driver properties](https://learn.microsoft.com/sql/connect/jdbc/setting-the-connection-properties){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-mysql.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,31 @@ The elements in the above configuration are described below:
279279
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
280280

281281

282-
282+
## Driver-Level Timeouts (Recommended for Production)
283+
284+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
285+
286+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
287+
288+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
289+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
290+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
291+
292+
Also note the distinction:
293+
294+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
295+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
296+
297+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
298+
299+
### Example: MySQL database
300+
301+
```toml
302+
[database.identity_db]
303+
url = "jdbc:mysql://DB_HOST:3306/WSO2_IDENTITY_DB?connectTimeout=10000&socketTimeout=60000&tcpKeepAlive=true"
304+
username = "..."
305+
password = "..."
306+
driver = "com.mysql.cj.jdbc.Driver"
307+
```
308+
309+
Learn more in [MySQL Connector/J properties](https://docs.oracle.com/cd/E19509-01/820-3497/agqju/index.html){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-oracle-rac.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,31 @@ validate, it will be dropped from the pool, and another attempt will be made to
201201
Pool](http://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html#Tomcat_JDBC_Enhanced_Attributes).
202202

203203

204-
204+
## Driver-Level Timeouts (Recommended for Production)
205+
206+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
207+
208+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
209+
210+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
211+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
212+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
213+
214+
Also note the distinction:
215+
216+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
217+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
218+
219+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
220+
221+
### Example: Oracle RAC database
222+
223+
```toml
224+
[database.identity_db]
225+
url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DB_HOST1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=DB_HOST2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=WSO2_IDENTITY_DB)))?oracle.net.CONNECT_TIMEOUT=10000&oracle.jdbc.ReadTimeout=60000"
226+
username = "..."
227+
password = "..."
228+
driver = "oracle.jdbc.OracleDriver"
229+
```
230+
231+
Learn more in [Oracle JDBC RAC URLs](https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/data-sources-and-URLs.html){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-oracle.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,31 @@ The elements in the above configuration are described below:
267267
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
268268

269269

270-
270+
## Driver-Level Timeouts (Recommended for Production)
271+
272+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
273+
274+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
275+
276+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
277+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
278+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
279+
280+
Also note the distinction:
281+
282+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
283+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
284+
285+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
286+
287+
### Example: Oracle database
288+
289+
```toml
290+
[database.identity_db]
291+
url = "jdbc:oracle:thin:@//DB_HOST:1521/WSO2_IDENTITY_DB?oracle.net.CONNECT_TIMEOUT=10000&oracle.jdbc.ReadTimeout=60000"
292+
username = "..."
293+
password = "..."
294+
driver = "oracle.jdbc.OracleDriver"
295+
```
296+
297+
Learn more in [Oracle JDBC data sources & URLs](https://docs.oracle.com/en/database/oracle/oracle-database/19/jjdbc/data-sources-and-URLs.html){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-postgresql.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,31 @@ The elements in the above configuration are described below:
267267
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
268268

269269

270-
270+
## Driver-Level Timeouts (Recommended for Production)
271+
272+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
273+
274+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
275+
276+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
277+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
278+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
279+
280+
Also note the distinction:
281+
282+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
283+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
284+
285+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
286+
287+
### Example: PostgreSQL database
288+
289+
```toml
290+
[database.identity_db]
291+
url = "jdbc:postgresql://DB_HOST:5432/WSO2_IDENTITY_DB?connectTimeout=10&socketTimeout=60&tcpKeepAlive=true"
292+
username = "..."
293+
password = "..."
294+
driver = "org.postgresql.Driver"
295+
```
296+
297+
Learn more in [PostgreSQL JDBC connection parameters](https://jdbc.postgresql.org/documentation/use/#connection-parameters){: target="_blank"}.

en/identity-server/5.10.0/docs/setup/changing-to-remote-h2.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,31 @@ The elements in the above configuration are described below:
286286
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
287287

288288

289-
289+
## Driver-Level Timeouts (Recommended for Production)
290+
291+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
292+
293+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
294+
295+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
296+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
297+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
298+
299+
Also note the distinction:
300+
301+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
302+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
303+
304+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
305+
306+
### Example: Remote H2 database
307+
308+
```toml
309+
[database.identity_db]
310+
url = "jdbc:h2:tcp://localhost/~/WSO2_IDENTITY_DB;QUERY_TIMEOUT=60000"
311+
username = "..."
312+
password = "..."
313+
driver = "org.h2.Driver"
314+
```
315+
316+
Learn more in [H2 connection settings](http://www.h2database.com/html/features.html#connection_settings){: target="_blank"}.

en/identity-server/5.11.0/docs/setup/changing-to-ibm-db2.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,5 +280,32 @@ The elements in the above configuration are described below:
280280
| |
281281
| **rollbackOnReturn** | If ` defaultAutoCommit ` =false, then you can set ` rollbackOnReturn ` =true so that the pool can terminate the transaction by calling rollback on the connection as it is returned to the pool. The default value is false. |
282282

283+
## Driver-Level Timeouts (Recommended for Production)
284+
285+
If the database becomes unresponsive, WSO2 Identity Server threads can get stuck waiting for a JDBC connection. This happens because the Tomcat JDBC Pool can't abort connection creation by itself ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L693-L702){: target="_blank"}).
286+
287+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
288+
289+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
290+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
291+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
292+
293+
Also note the distinction:
294+
295+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
296+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
297+
298+
> **Note:** The `PoolExhaustedException` warning log is logged only when `maxWait` expires ([source](https://github.com/apache/tomcat/blob/9.0.82/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java#L739-L741){: target="_blank"}). It does **not** cover delays inside the driver’s connection or read operations. Driver-level timeouts are required to handle those cases.
299+
300+
### Example: IBM DB2 database
301+
302+
```toml
303+
[database.identity_db]
304+
url = "jdbc:db2://DB_HOST:50000/WSO2_IDENTITY_DB:loginTimeout=10;queryTimeout=60;"
305+
username = "..."
306+
password = "..."
307+
driver = "com.ibm.db2.jcc.DB2Driver"
308+
```
309+
310+
Learn more in [IBM DB2 connection settings](https://www.ibm.com/docs/en/db2/11.5?topic=client-jdbc-properties){: target="_blank"}.
283311

284-

0 commit comments

Comments
 (0)