AEM: JDBC connection issue

Avatar

Avatar
Level 1
truptip68838231
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
truptip68838231
Level 1

Likes

0 likes

Total Posts

2 posts

Correct reply

0 solutions
View profile
truptip68838231
Level 1

15-10-2020

We are facing wait timeout exceptions while connecting to JDBC database and it happens intermittently. It is happening when only when there is lot of idle time in the night.

 

Exception details :


{"errorType":"SQL Exception Occured","appName":"Custom-Service","responseMessage":"The last packet successfully received from the server was 52,364,564 milliseconds ago. The last packet sent successfully to the server was 52,364,564 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.","responseCode":500}

 

JDBC config:

jdbc.driver.class="com.mysql.jdbc.Driver"
jdbc.connection.uri="jdbc:mysql://url"
jdbc.validation.query="SELECT\ 1\ FROM\ DUAL"
datasource.svc.properties=[""]
default.readonly=B"false"
default.autocommit=B"true"
pool.max.wait.msec=L"100000"
pool.size=L"100000"

 

We tried by increasing wait timeout but still for some users it is failing on higher environments. We also tried with 'autoReconnect=true', but that is also not fixed the issue. Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back
Level 2
narendragandhi
Level 2

Likes

17 likes

Total Posts

14 posts

Correct reply

6 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Give Back
Level 2
narendragandhi
Level 2

Likes

17 likes

Total Posts

14 posts

Correct reply

6 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 10
Boost 1
View profile
narendragandhi
Level 2

15-10-2020

 
 
 

Hi @truptip68838231 

 

I believe you are using the Day Commons JDBC Connections Pool. I would suggest to try the Apache Sling Connection Pooled datasource which is based on http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

 

While I don't have the comparison between the 2 it looks like the apache Sling Connection Pooled datasource should handle your scenario of idle connections better. Here is a reference link on how to configure it - https://helpx.adobe.com/experience-manager/6-3/forms/using/data-integration.html

 

Thanks

Narendra

Answers (1)

Answers (1)

Avatar

Avatar
Establish
MVP
santhosh_kumark
MVP

Likes

99 likes

Total Posts

111 posts

Correct reply

38 solutions
Top badges earned
Establish
Validate 1
Give Back 3
Give Back
Boost 50
View profile

Avatar
Establish
MVP
santhosh_kumark
MVP

Likes

99 likes

Total Posts

111 posts

Correct reply

38 solutions
Top badges earned
Establish
Validate 1
Give Back 3
Give Back
Boost 50
View profile
santhosh_kumark
MVP

16-10-2020

Hi @truptip68838231 ,

 

Hope this article will help you out to fix this issue.

  1. https://stackoverflow.com/questions/41745219/oracle-jdbc-connection-timed-out-issue

Possibility : Pool size is not enough if usability of application is too high 

Solution: Need to increase the pool size. (It is applicable if you properly closes all the connection after use)

 

Regards,

Santosh