equal
deleted
inserted
replaced
104 def __init__(self, session, free_cnxset=True): |
104 def __init__(self, session, free_cnxset=True): |
105 self.session = session |
105 self.session = session |
106 self.free_cnxset = free_cnxset |
106 self.free_cnxset = free_cnxset |
107 |
107 |
108 def __enter__(self): |
108 def __enter__(self): |
109 pass |
109 # ensure session has a cnxset |
|
110 self.session.set_cnxset() |
110 |
111 |
111 def __exit__(self, exctype, exc, traceback): |
112 def __exit__(self, exctype, exc, traceback): |
112 if exctype: |
113 if exctype: |
113 self.session.rollback(free_cnxset=self.free_cnxset) |
114 self.session.rollback(free_cnxset=self.free_cnxset) |
114 else: |
115 else: |