equal
deleted
inserted
replaced
841 # needed for the recursive handling of disconnections (otherwise we |
841 # needed for the recursive handling of disconnections (otherwise we |
842 # deadlock on self._eid_creation_lock |
842 # deadlock on self._eid_creation_lock |
843 if self._eid_creation_cnx is None: |
843 if self._eid_creation_cnx is None: |
844 self._eid_creation_cnx = self.get_connection() |
844 self._eid_creation_cnx = self.get_connection() |
845 cnx = self._eid_creation_cnx |
845 cnx = self._eid_creation_cnx |
846 cursor = cnx.cursor() |
846 try: |
847 try: |
847 cursor = cnx.cursor() |
848 for sql in self.dbhelper.sqls_increment_sequence('entities_id_seq'): |
848 for sql in self.dbhelper.sqls_increment_sequence('entities_id_seq'): |
849 cursor.execute(sql) |
849 cursor.execute(sql) |
850 eid = cursor.fetchone()[0] |
850 eid = cursor.fetchone()[0] |
851 except (self.OperationalError, self.InterfaceError): |
851 except (self.OperationalError, self.InterfaceError): |
852 # FIXME: better detection of deconnection pb |
852 # FIXME: better detection of deconnection pb |