[session] update session's timestamp in session.execute, so long running transactions are not erroneously closed by the repository stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 18 Jun 2010 15:41:39 +0200
branchstable
changeset 5792 e13aa4786a72
parent 5791 274a5a6080a7
child 5793 1faff41593df
[session] update session's timestamp in session.execute, so long running transactions are not erroneously closed by the repository
server/session.py
--- a/server/session.py	Fri Jun 18 14:56:01 2010 +0200
+++ b/server/session.py	Fri Jun 18 15:41:39 2010 +0200
@@ -131,8 +131,7 @@
         self.user = user
         self.repo = repo
         self.cnxtype = cnxprops.cnxtype
-        self.creation = time()
-        self.timestamp = self.creation
+        self.timestamp = time()
         self.default_mode = 'read'
         # support undo for Create Update Delete entity / Add Remove relation
         if repo.config.creating or repo.config.repairing or self.is_internal_session:
@@ -651,6 +650,7 @@
         if eid_key is not None:
             warn('[3.8] eid_key is deprecated, you can safely remove this argument',
                  DeprecationWarning, stacklevel=2)
+        self.timestamp = time() # update timestamp
         rset = self._execute(self, rql, kwargs, build_descr)
         rset.req = self
         return rset