Dbo backend reconnect and reentract statement exception
I have a task scheduler in my Wt application which repeatedly runs the same instances of Wt::Dbo::Query<...> after an interval. It works fine however in the case where connection to the backend(MySQL) is lost and that Wt Dbo reconnects and runs those queries after reconnecting, an uncatchable exception is thrown stating that reentrant queries/statements are not supported.
It is difficult to make a test file since the problem occurs sometimes when it reconnects. In my case it happens when my laptop wakes up from a long hibernation or sleep. However if you have trouble reproducing the error I can write something up.
My suggestion to reproduce is:
1. Create a valid Dbo::Query instance(s)
- Create a function that is repeatedly called in an interval which runs the query(s) and run the test app (I use WIOService::post)
- Turn off backend
- Break when connection lost is detected by Wt Dbo
- Turn on backend and let Wt Dbo reconnect and run the query again
- I guess it should give you the reentrant access error now
Updated by Roel Standaert over 6 years ago
- Status changed from InProgress to Feedback
I haven't been able to reproduce this exact behavior, but I observed another issue when debugging this. The reconnection behavior has now changed from relying on automatic reconnects to an explicit reconnect, so can you check if the current version on GitHub still has this issue?