Skip to content

Fix for stale DB connection properties and uncaught errors - #12

Open
itoolsTim wants to merge 3 commits into
mainfrom
bugfix/zendb-reconnect-stale
Open

Fix for stale DB connection properties and uncaught errors#12
itoolsTim wants to merge 3 commits into
mainfrom
bugfix/zendb-reconnect-stale

Conversation

@itoolsTim

Copy link
Copy Markdown

A small number of fixes to handle connections that may fail behind the scenes and need retrying. Not well documented is the fact that stat() can throw an Error in addition to the exception.

Also the fixes included changes to making sure isConnected() is properly showing the correct state after a failure.

I have included tests. Make sure the tests work for your instances just as a double check.

…ted. This also leads isConnected() to properly show false on failed connection.
…r if db closed behind its back (doesn't appear to be documented extensively) and the second addresses properly updating snapshots instead of letting connection #1 lingering.
… connection is closed behind its back. Now disconnect() always leaves the object clean, and since $this->mysqli becomes null, a following connect() works.
@itoolsTim
itoolsTim requested review from daveedis and a lite review from Copilot and removed request for Copilot August 25, 2026 00:03
@itoolsTim itoolsTim changed the title Bugfix/zendb reconnect stale Fix for stale DB connection properties and uncaught errors Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants