Discussion:
[soci-users] Detect disconnected sessions
Abbas Yazdanpanah
2016-01-10 13:45:33 UTC
Permalink
Dear All

I'm noob here so please bear with me. This is the situation. I've an
application that works 24/7 as a server. It use a thread pool alongside
with a connection pool to store data into mysql using soci. In rare
occasions (it happened once in couple of months), all the connections in
the pool seems to be disconnected and nothing is stored in db. My best
guess right now is that the connections somehow are lost.

As far as I've investigated the issue, it seems if I can check health of
connections I might be able to mitigate this situation. But my search on
google didn't give me anything but this mailing list's history:

https://sourceforge.net/p/soci/mailman/message/30651348/

And it seems that isConnected is not implemented yet.

So please give your suggestion about :

- How can I implement or know the status of sessions underlying
connection?
- How can I check that everything is working correctly or not? And if
not how can I repair it? specially in multi-threaded environment with a
connection pool.

Thank you in advance for helping me.

Abbas.
Mateusz Loskot
2016-01-11 10:16:19 UTC
Permalink
Post by Abbas Yazdanpanah
As far as I've investigated the issue, it seems if I can check health of
connections I might be able to mitigate this situation. But my search on
https://sourceforge.net/p/soci/mailman/message/30651348/
And it seems that isConnected is not implemented yet.
Yes, it is not, for the reasons given in that discussion thread.
Post by Abbas Yazdanpanah
How can I implement or know the status of sessions underlying connection?
How can I check that everything is working correctly or not? And if not how
can I repair it? specially in multi-threaded environment with a connection
pool.
I can only suggest to try some of the ideas discussed in that thread,

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Loading...