Homec4science

Move connection cache from "AphrontDatabaseConnection"-level to "LiskDAO"-level

Authored by epriestley <git@epriestley.com> on Apr 30 2012, 20:57.

Description

Move connection cache from "AphrontDatabaseConnection"-level to "LiskDAO"-level

Summary:

  • Currently, connections are responsible for connection caching. However, I want unit tests to be able to say "throw away the entire connection cache" with storage fixtures, and this is difficult/impossible when connections are responsible for the cache.
  • The only behavioral change is that previously we would use the same connection for read-mode and write-mode queries. We'll now establish two connections. No installs actually differentiate between the modes so it isn't particularly relevant what we do here. In the long term, we should probably check the "w" cache before building a new "r" connection, so transactional code which involves reads and writes works (we don't have any such code right now).

Test Plan: Loaded pages, verified only one connection was established per database. Ran unit tests.

Reviewers: btrahan, vrana, jungejason, edward

Reviewed By: vrana

CC: aran

Maniphest Tasks: T140

Differential Revision: https://secure.phabricator.com/D2342

Details

Committed
epriestley <git@epriestley.com>Apr 30 2012, 20:57
Pushed
aubortJan 31 2017, 17:16
Parents
rPH570feee1999f: Make default database namespace configurable
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHa10b91a6a90a: Move connection cache from "AphrontDatabaseConnection"-level to "LiskDAO"-level (authored by epriestley <git@epriestley.com>).Apr 30 2012, 20:57