server/session.py
branchstable
changeset 8529 1daea1f433c9
parent 8433 ff9d6d269877
child 8535 268b6349baf3
child 8585 3f60f416dddb
equal deleted inserted replaced
8528:f32c50c6b7e0 8529:1daea1f433c9
   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: