Commit 79f4db67 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[entity edition] don't remove values from attribute cache on the repository side

This follows changesets 552de9f0c46d, 1527b012802f, 25da1e5c7c50 and 4ba11607d84a.

closes #2423719 ?
parent 552de9f0c46d
......@@ -559,10 +559,14 @@ class Entity(AppObject):
raise NotImplementedError('comparison not implemented for %s' % self.__class__)
def _cw_update_attr_cache(self, attrcache):
for key in self._cw.get_shared_data('%s.dont-cache-attrs' % self.eid,
# if context is a repository session, don't consider dont-cache-attrs as
# the instance already hold modified values and loosing them could
# introduce severe problems
if self._cw.is_request:
for attr in self._cw.get_shared_data('%s.dont-cache-attrs' % self.eid,
default=(), txdata=True, pop=True):
attrcache.pop(key, None)
self.cw_attr_cache.pop(key, None)
attrcache.pop(attr, None)
self.cw_attr_cache.pop(attr, None)
self.cw_attr_cache.update(attrcache)
def _cw_dont_cache_attribute(self, attr):
......
......@@ -62,6 +62,8 @@ class RequestSessionBase(object):
:attribute vreg.schema: the instance's schema
:attribute vreg.config: the instance's configuration
"""
is_request = True # False for repository session
def __init__(self, vreg):
self.vreg = vreg
try:
......
......@@ -241,6 +241,7 @@ class Session(RequestSessionBase):
:attr:`running_dbapi_query`, boolean flag telling if the executing query
is coming from a dbapi connection or is a query from within the repository
"""
is_request = False
is_internal_session = False
def __init__(self, user, repo, cnxprops=None, _id=None):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment