changeset 8f0eb6f2e910 in trytond:6.2
details: https://hg.tryton.org/trytond?cmd=changeset&node=8f0eb6f2e910
description:
        Clear transaction cache after commit

        If there are multiple commits, the data in the database may have been 
modified.

        issue11014
        review381481003
        (grafted from f23258f695042a5958e53f54de153ccdda541121)
diffstat:

 trytond/transaction.py |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 33dcdd3129a7 -r 8f0eb6f2e910 trytond/transaction.py
--- a/trytond/transaction.py    Fri Dec 03 21:42:00 2021 +0100
+++ b/trytond/transaction.py    Thu Dec 16 22:12:42 2021 +0100
@@ -237,6 +237,8 @@
                 for datamanager in self._datamanagers:
                     datamanager.tpc_vote(self)
             self.started_at = self.monotonic_time()
+            for cache in self.cache.values():
+                cache.clear()
             Cache.commit(self)
             self.connection.commit()
         except Exception:

Reply via email to