Expand my Community achievements bar.

Elevate your expertise and be recognized as a true influencer! Nominations for the exclusive Adobe Community Advisor program 2023 are now OPEN.
SOLVED

LCDS Lost Connection

Avatar

Level 1

when LCDS first starts, everything goes smoothly, however, after a long time of no activity, when user reload the page, the error message is returned, and says the data cannot be pulled, but the second time the user reload the page, everything goes fine again.

for me, it seems LCDS drop the database connection after no user pulls the data for a long period, does anyone else experience the same issue?

1 Accepted Solution

Avatar

Correct answer by
Level 3

Are you using MySQL as your database? MySQL automatically drops idle connections after a set amount of time (See the wait_timeout setting: http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout and also here: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html) If so, you can try increasing the wait_timeout value if there are extended intervals when no one accesses the server, or tweaking your connection properties to have it auto-reconnect.

Besides that, you can try configuring your pool to check connections before returning them. For e.g. on DBCP you can try the testOnBorrow/testWhileIdle settings. Note that testing a connection every time (on borrow) is expensive.

4 Replies

Avatar

Correct answer by
Level 3

Are you using MySQL as your database? MySQL automatically drops idle connections after a set amount of time (See the wait_timeout setting: http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout and also here: http://dev.mysql.com/doc/refman/5.0/en/gone-away.html) If so, you can try increasing the wait_timeout value if there are extended intervals when no one accesses the server, or tweaking your connection properties to have it auto-reconnect.

Besides that, you can try configuring your pool to check connections before returning them. For e.g. on DBCP you can try the testOnBorrow/testWhileIdle settings. Note that testing a connection every time (on borrow) is expensive.

Avatar

Level 1

thanks for the reply.

that solution can work for me.

do you know if any error code or exception will be thrown(i am getting JDBC fail: null), so far i try to catch that event/exception so i can wait for a few seconds and re-try to pull the data.

Avatar

Level 3

I am not sure of the exact error code. Overall, I feel it would be better if you could configure your DB/Connection/Pool so that it never causes the exception to occur on the Java side...

Avatar

Level 1

thanks Ashish for your help.