Skip to content

Commit 320e5d3

Browse files
next Docs
1 parent 8bebbb2 commit 320e5d3

File tree

8 files changed

+127
-1
lines changed

8 files changed

+127
-1
lines changed

en/identity-server/next/docs/deploy/configure/databases/carbon-database/change-to-ibm-db2.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,19 @@ Apart from the basic configurations specified above, WSO2 Identity Server suppor
123123
### Configure the connection pool to rollback pending transactions on connection return
124124

125125
{% include "../../../../includes/rollback-pending.md" %}
126+
127+
### Driver-Level Timeouts (Recommended for Production)
128+
129+
{% include "../../../../includes/driver-level-timeouts.md" %}
130+
131+
#### Example: IBM DB2 database
132+
133+
```toml
134+
[database.identity_db]
135+
url = "jdbc:db2://DB_HOST:50000/WSO2_IDENTITY_DB:loginTimeout=10;queryTimeout=60;"
136+
username = "..."
137+
password = "..."
138+
driver = "com.ibm.db2.jcc.DB2Driver"
139+
```
140+
141+
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/next/docs/deploy/configure/databases/carbon-database/change-to-mssql.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,19 @@ A sample configuration is given below.
122122
### Configure the connection pool to rollback pending transactions on connection return
123123

124124
{% include "../../../../includes/rollback-pending.md" %}
125+
126+
### Driver-Level Timeouts (Recommended for Production)
127+
128+
{% include "../../../../includes/driver-level-timeouts.md" %}
129+
130+
#### Example: MSSQL database
131+
132+
```toml
133+
[database.identity_db]
134+
url = "jdbc:sqlserver://DB_HOST:1433;databaseName=WSO2_IDENTITY_DB;loginTimeout=10;socketTimeout=60000"
135+
username = "..."
136+
password = "..."
137+
driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"
138+
```
139+
140+
Learn more in [Microsoft JDBC driver properties](https://learn.microsoft.com/sql/connect/jdbc/setting-the-connection-properties){: target="_blank"}.

en/identity-server/next/docs/deploy/configure/databases/carbon-database/change-to-mysql.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,19 @@ A sample configuration is given below.
118118
### Configure the connection pool to rollback pending transactions on connection return
119119

120120
{% include "../../../../includes/rollback-pending.md" %}
121+
122+
### Driver-Level Timeouts (Recommended for Production)
123+
124+
{% include "../../../../includes/driver-level-timeouts.md" %}
125+
126+
#### Example: MySQL database
127+
128+
```toml
129+
[database.identity_db]
130+
url = "jdbc:mysql://DB_HOST:3306/WSO2_IDENTITY_DB?connectTimeout=10000&socketTimeout=60000&tcpKeepAlive=true"
131+
username = "..."
132+
password = "..."
133+
driver = "com.mysql.cj.jdbc.Driver"
134+
```
135+
136+
Learn more in [MySQL Connector/J properties](https://docs.oracle.com/cd/E19509-01/820-3497/agqju/index.html){: target="_blank"}.

en/identity-server/next/docs/deploy/configure/databases/carbon-database/change-to-oracle-rac.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,19 @@ Apart from the basic configurations specified above, WSO2 Identity Server suppor
122122
```
123123

124124
{% include "../../../../includes/db-config-table.md" %}
125+
126+
### Driver-Level Timeouts (Recommended for Production)
127+
128+
{% include "../../../../includes/driver-level-timeouts.md" %}
129+
130+
#### Example: Oracle RAC database
131+
132+
```toml
133+
[database.identity_db]
134+
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"
135+
username = "..."
136+
password = "..."
137+
driver = "oracle.jdbc.OracleDriver"
138+
```
139+
140+
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/next/docs/deploy/configure/databases/carbon-database/change-to-oracle.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,19 @@ When the database owner is not the user used to connect to the database, specify
149149
### Configure the connection pool to rollback pending transactions on connection return
150150

151151
{% include "../../../../includes/rollback-pending.md" %}
152+
153+
### Driver-Level Timeouts (Recommended for Production)
154+
155+
{% include "../../../../includes/driver-level-timeouts.md" %}
156+
157+
#### Example: Oracle database
158+
159+
```toml
160+
[database.identity_db]
161+
url = "jdbc:oracle:thin:@//DB_HOST:1521/WSO2_IDENTITY_DB?oracle.net.CONNECT_TIMEOUT=10000&oracle.jdbc.ReadTimeout=60000"
162+
username = "..."
163+
password = "..."
164+
driver = "oracle.jdbc.OracleDriver"
165+
```
166+
167+
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/next/docs/deploy/configure/databases/carbon-database/change-to-postgresql.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,19 @@ Apart from the basic configurations specified above, WSO2 Identity Server suppor
115115
### Configure the connection pool to rollback pending transactions on connection return
116116

117117
{% include "../../../../includes/rollback-pending.md" %}
118+
119+
### Driver-Level Timeouts (Recommended for Production)
120+
121+
{% include "../../../../includes/driver-level-timeouts.md" %}
122+
123+
#### Example: PostgreSQL database
124+
125+
```toml
126+
[database.identity_db]
127+
url = "jdbc:postgresql://DB_HOST:5432/WSO2_IDENTITY_DB?connectTimeout=10&socketTimeout=60&tcpKeepAlive=true"
128+
username = "..."
129+
password = "..."
130+
driver = "org.postgresql.Driver"
131+
```
132+
133+
Learn more in [PostgreSQL JDBC connection parameters](https://jdbc.postgresql.org/documentation/use/#connection-parameters){: target="_blank"}.

en/identity-server/next/docs/deploy/configure/databases/carbon-database/change-to-remote-h2.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,20 @@ A sample configuration is given below.
131131

132132
### Configure the connection pool to rollback pending transactions on connection return
133133

134-
{% include "../../../../includes/rollback-pending.md" %}
134+
{% include "../../../../includes/rollback-pending.md" %}
135+
136+
### Driver-Level Timeouts (Recommended for Production)
137+
138+
{% include "../../../../includes/driver-level-timeouts.md" %}
139+
140+
#### Example: Remote H2 database
141+
142+
```toml
143+
[database.identity_db]
144+
url = "jdbc:h2:tcp://localhost/~/WSO2_IDENTITY_DB;QUERY_TIMEOUT=60000"
145+
username = "..."
146+
password = "..."
147+
driver = "org.h2.Driver"
148+
```
149+
150+
Learn more in [H2 connection settings](http://www.h2database.com/html/features.html#connection_settings){: target="_blank"}.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
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"}).
2+
3+
To prevent this, configure **driver-level timeouts** in the JDBC URL:
4+
5+
- **`connectTimeout`** → Maximum time to wait while establishing a database connection.
6+
- **`socketTimeout`** (or driver-specific equivalent) → Maximum time to wait for responses on an active connection.
7+
- **`tcpKeepAlive=true`** (if supported) → Helps detect unresponsive database servers.
8+
9+
Also note the distinction:
10+
11+
- **`maxWait`** (Tomcat pool) controls how long to wait for a free connection from the pool.
12+
- **`connectTimeout` / `socketTimeout`** (driver) → how long to connect/read at the DB level.
13+
14+
> **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.

0 commit comments

Comments
 (0)