server/repository.py
branchstable
changeset 7706 359bc86d2827
parent 7698 1c7411535c2d
child 7708 45be3a9debe6
equal deleted inserted replaced
7705:2a1f078ebdcd 7706:359bc86d2827
   925             if session.timestamp < mintime:
   925             if session.timestamp < mintime:
   926                 self.close(session.id)
   926                 self.close(session.id)
   927                 nbclosed += 1
   927                 nbclosed += 1
   928         return nbclosed
   928         return nbclosed
   929 
   929 
   930     def internal_session(self, cnxprops=None):
   930     def internal_session(self, cnxprops=None, safe=False):
   931         """return a dbapi like connection/cursor using internal user which
   931         """return a dbapi like connection/cursor using internal user which have
   932         have every rights on the repository. You'll *have to* commit/rollback
   932         every rights on the repository. The `safe` argument is a boolean flag
   933         or close (rollback implicitly) the session once the job's done, else
   933         telling if integrity hooks should be activated or not.
   934         you'll leak connections set up to the time where no one is
   934 
   935         available, causing irremediable freeze...
   935         *YOU HAVE TO* commit/rollback or close (rollback implicitly) the
   936         """
   936         session once the job's done, else you'll leak connections set up to the
   937         session = InternalSession(self, cnxprops)
   937         time where no one is available, causing irremediable freeze...
       
   938         """
       
   939         session = InternalSession(self, cnxprops, safe)
   938         session.set_cnxset()
   940         session.set_cnxset()
   939         return session
   941         return session
   940 
   942 
   941     def _get_session(self, sessionid, setcnxset=False, txid=None,
   943     def _get_session(self, sessionid, setcnxset=False, txid=None,
   942                      checkshuttingdown=True):
   944                      checkshuttingdown=True):