server/session.py
changeset 5811 e77cea9721e7
parent 5707 3586d36d2a45
parent 5802 159b6a712d9d
child 5815 282194aa43f3
--- a/server/session.py	Fri Jun 18 18:31:22 2010 +0200
+++ b/server/session.py	Mon Jun 21 13:23:11 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:
@@ -286,8 +285,10 @@
         try:
             return source.doexec(self, sql, args, rollback=rollback_on_failure)
         except (source.OperationalError, source.InterfaceError):
+            if not rollback_on_failure:
+                raise
             source.warning("trying to reconnect")
-            self.pool.reconnect(self)
+            self.pool.reconnect(source)
             return source.doexec(self, sql, args, rollback=rollback_on_failure)
 
     def set_language(self, language):
@@ -642,6 +643,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