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?
Solved! Go to Solution.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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...
Views
Replies
Total Likes
thanks Ashish for your help.
Views
Replies
Total Likes