equal
deleted
inserted
replaced
417 |
417 |
418 """ |
418 """ |
419 |
419 |
420 is_request = False |
420 is_request = False |
421 |
421 |
422 def __init__(self, cnxid, session): |
422 def __init__(self, session, cnxid): |
423 # using super(Connection, self) confuse some test hack |
423 # using super(Connection, self) confuse some test hack |
424 RequestSessionBase.__init__(self, session.vreg) |
424 RequestSessionBase.__init__(self, session.vreg) |
425 #: connection unique id |
425 #: connection unique id |
426 self.connectionid = cnxid |
426 self.connectionid = cnxid |
427 #: reentrance handling |
427 #: reentrance handling |
1257 try: |
1257 try: |
1258 if self.closed: |
1258 if self.closed: |
1259 raise SessionClosedError('try to access connections set on a closed session %s' % self.id) |
1259 raise SessionClosedError('try to access connections set on a closed session %s' % self.id) |
1260 cnx = self._cnxs[cnxid] |
1260 cnx = self._cnxs[cnxid] |
1261 except KeyError: |
1261 except KeyError: |
1262 cnx = Connection(cnxid, self) |
1262 cnx = Connection(self, cnxid=cnxid) |
1263 self._cnxs[cnxid] = cnx |
1263 self._cnxs[cnxid] = cnx |
1264 return cnx |
1264 return cnx |
1265 |
1265 |
1266 def set_cnx(self, cnxid=None): |
1266 def set_cnx(self, cnxid=None): |
1267 """set the default connection of the current thread to <cnxid> |
1267 """set the default connection of the current thread to <cnxid> |