Bug #4936

Dbo backend reconnect and reentract statement exception

Added by Saif Rehman over 6 years ago. Updated over 6 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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)

  1. Create a function that is repeatedly called in an interval which runs the query(s) and run the test app (I use WIOService::post)
  2. Turn off backend
  3. Break when connection lost is detected by Wt Dbo
  4. Turn on backend and let Wt Dbo reconnect and run the query again
  5. I guess it should give you the reentrant access error now

Updated by Koen Deforche over 6 years ago

  • Status changed from New to InProgress
  • Assignee set to Roel Standaert

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?


Updated by Saif Rehman over 6 years ago

Hi, sorry for the very late reply, I shall check it out when I get free from my current responsibilities.

Also available in: Atom PDF