zodb / relstorage

A backend for ZODB that stores pickles in a relational database.
Other
55 stars 46 forks source link

Internals: Connection handling too complicated #390

Open jamadden opened 4 years ago

jamadden commented 4 years ago

There's the generic LoadConnection and StoreConnection objects, new in RS 3.0, that encapsulate the lifetime of a connection and its cursors. New code is using that.

Then there's the IDBDriver object that actually knows how to open connections and set various connection and driver-specific bits, including knowing how to get database warnings and such.

Finally, there's the original ConnManager adapter object which the Load and Store connections delegate most operations to, which in turn delegates most operations to the IDBDriver, but which also has some knowledge about things like isolation levels.

The responsibilities are not well factored and figuring out who does what can be confusing. I think perhaps the ConnManager needs to go away, with its responsibilities divided among the IDBDriver and Load and Store connections.