Question

I have a problem in WSO2 DSS, the database connection timeout is occurring after a few hours, then I have to stopping and starting the DSS to work.

The DSS version is 2.5.1

the database server is sql server can help me ? Thank

Was it helpful?

Solution

Have you properly configured your datasource that's used in the dataservice descriptor file to enable "validationQuery" parameter to "SELECT 1" (validation query can vary depending on the RDBMS type used but for SQL server you can use the aforementioned query) and "testOnBorrow" parameter to "true"?

To give you a bit of context on the issue, any RDBMS type by default has a connection timeout value defined. For example, MySQL has a default timeout of 8 hours by default. When connection pooling is used in an application, the connections are kept in the pool once they are created without physically closing to reuse them. However, after the aforementioned period of time, the connections become stale and you have to validate the connections before using them. This is done by specifying a validation query which will be executed whenever a pooled connection is reused. and the "testOnBorrow" parameter comes handy as, when specified, it will validate the pooled connections when they are borrowed from the conneciton pool.

Cheers, Prabath

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top