diff -r e0b63ea2c65b -r aff75b69db92 server/repository.py --- a/server/repository.py Thu Jun 27 19:18:54 2013 +0200 +++ b/server/repository.py Tue Jul 02 17:09:04 2013 +0200 @@ -953,6 +953,8 @@ every rights on the repository. The `safe` argument is a boolean flag telling if integrity hooks should be activated or not. + /!\ the safe argument is False by default. + *YOU HAVE TO* commit/rollback or close (rollback implicitly) the session once the job's done, else you'll leak connections set up to the time where no one is available, causing irremediable freeze... @@ -962,17 +964,17 @@ return session @contextmanager - def internal_cnx(self, safe=True): + def internal_cnx(self): """return a Connection using internal user which have - every rights on the repository. The `safe` argument is a boolean flag - telling if integrity hooks should be activated or not. + every rights on the repository. The `safe` argument is dropped. all + hook are enabled by default. - /!\ IN OPPOSITE OF THE OLDER INTERNAL_SESSION, INTERNAL CONNECTION ARE SAFE - /!\ BY DEFAULT. + /!\ IN OPPOSITE OF THE OLDER INTERNAL_SESSION, + /!\ INTERNAL CONNECTION HAVE ALL HOOKS ENABLED. This is to be used a context manager. """ - with InternalSession(self, safe) as session: + with InternalSession(self) as session: with session.new_cnx() as cnx: yield cnx