Should fail sooner when objects and their connections are missused

Bug #977584 reported by Jim Fulton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ZODB
New
Undecided
Unassigned

Bug Description

A common bug is to store a saved persistent object somewhere disconnected from its connection.
When the object is modified, it gets registered with the connection while the connection is closed.
This leads, typically in an unrelates thread to the dreaded "Cannot close a connection joined to
a transaction" error.

In _register, we should check that the connection is opened and error if it isn't.

It would ne nice to catch errant writes even when a connection is open.
Since 99.999% only one thread uses a connection (in a correct program)
we could check that register is called from the thread that opened a
connection. This would break wildly advanced programs that do
correctly pass connections among threads. We could add a
"multithreaded" option to open to disable this check for people
who think they're smart enough. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.