pculture/miro — pull request #74 by geoffl (2011-11-10 07:46:11+00:00)
Title: bz18422: Index active database objects via (id, table name).

It seems that in very rare circumstances we have seen database object
ids being duplicated across different tables, though we believe that
to be impossible based on code inspection and we cannot come up
with a viable explanation as to why it may happen.

Indexing also by the table name will solve the issue.

Additionally, put in a check in database object __init__ to confirm
that this is only run within the backend thread to ensure gated
sequential access to the database id allocator.

NOTE: I have deliberately kept the function names the same as I think
they still make sense. And I have also consciously kept the id allocator
on a global basis for now.