Subject: bug#32234: [PATCH 2/2] database: Serialize all database accesses in a thread.

From: Danny Milosavljevic <[email-masked]>
Date: Mon, 27 Aug 2018 14:41:48 +0200

Hi Clément,

in the future I plan on making the actual bin/evaluate use another database connection
in order for the web interface to be isolated while it's querying.

Otherwise - as it is now in master - it can happen that while you are querying one
page, half of the things have different values than you requested - which is really
weird.

For example right now you could query for a row with status=42 and get back data with
status=43 (because it has been changed in the mean time).

It's better to have serializable transaction isolation to prevent this.  That means
that each connection will have its own worldview that is fixed at the beginning of
the connection's transaction.  The worldview will update only once a new transaction
starts.

Therefore, it would be good for writers to have their own connection in the long run
(really, for the readers to have their own connection - but that comes out the same).

So it would be good to keep this in mind.