448 is_request = False |
448 is_request = False |
449 hooks_in_progress = False |
449 hooks_in_progress = False |
450 is_repo_in_memory = True # bw compat |
450 is_repo_in_memory = True # bw compat |
451 mode = 'read' |
451 mode = 'read' |
452 |
452 |
453 def __init__(self, session, cnxid=None, session_handled=False): |
453 def __init__(self, session): |
454 # using super(Connection, self) confuse some test hack |
454 # using super(Connection, self) confuse some test hack |
455 RequestSessionBase.__init__(self, session.vreg) |
455 RequestSessionBase.__init__(self, session.vreg) |
456 # only the session provide explicite |
|
457 if cnxid is not None: |
|
458 assert session_handled # only session profive explicite cnxid |
|
459 #: connection unique id |
456 #: connection unique id |
460 self._open = None |
457 self._open = None |
461 if cnxid is None: |
458 self.connectionid = '%s-%s' % (session.sessionid, uuid4().hex) |
462 cnxid = '%s-%s' % (session.sessionid, uuid4().hex) |
|
463 self.connectionid = cnxid |
|
464 self.session = session |
459 self.session = session |
465 self.sessionid = session.sessionid |
460 self.sessionid = session.sessionid |
466 #: self._session_handled |
|
467 #: are the life cycle of this Connection automatically controlled by the |
|
468 #: Session This is the old backward compatibility mode |
|
469 self._session_handled = session_handled |
|
470 #: reentrance handling |
461 #: reentrance handling |
471 self.ctx_count = 0 |
462 self.ctx_count = 0 |
472 #: count the number of entry in a context needing a cnxset |
463 #: count the number of entry in a context needing a cnxset |
473 self._cnxset_count = 0 |
464 self._cnxset_count = 0 |
474 #: Boolean for compat with the older explicite set_cnxset/free_cnx API |
465 #: Boolean for compat with the older explicite set_cnxset/free_cnx API |