The test relies on the cache being cleared before setting a value from the old
transaction. So we must wait for the synchronisation to happen when channel is
used.
issue9413
review327461011
By using a class with slots instead of standard dict, we can reduce a lot the
memory usage to store the record data in the caches and values.
Also we can rely on the data in the cache to exist only for real field which
can be used to create a fast path in ModelStorage.__getattr__.
As now storing data in the cache has no extra cost, we can store data from the
transactional cache in the local. This allow also to have a shorter path in
ModelStorage.__getattr__.
For more memory efficiency, we remove the record from the cache instead of
clearing them. It was better to clear a dict but a record is less expensive to
re-instantiate than clearing.
issue9369
issue9225
review297861002
The tests did not correspond to a proper use case because the transaction
committed was not the current transaction. So this could lead to wrong cache
being reset and wrong cache being tested.
issue8502
review289171002
The table is a hot spot for contention so we must minimize the duration lock
are kept on it. As at the start of a transaction, the cache may be sync and so
it locks all the row in the table, the transaction used for this query should
not be the main one that lasts a long time. Idem for the commit.
issue8447
review283591002
When the clear timeout of the cache is zero, we launch a thread to synchronize
caches if the back-end support channels.
The thread is started on the first call to sync for the database.
The channel is also used to clear the cache of the process initiating the
clearing. This allows to test the mechanism is working with a single process.
So there will be a small delay even on single instance.
issue8027
review68431002
We implement sync, commit and rollback to follow transaction semantic.
When a transaction clears a cache, the global cache is cleared only when the
transaction is committed meanwhile the transaction will use a cache for itself
only.
We remove _nocache option because the sync, commit and rollback operate only
for the transaction.
issue7975
review53521002