server/sources/native.py
branchstable
changeset 6850 2b9e58174327
parent 6427 c8a5ac2d1eaa
child 6882 b5e34836f84e
child 6889 37668bf302f5
equal deleted inserted replaced
6846:4dd1df437e15 6850:2b9e58174327
   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