equal
deleted
inserted
replaced
264 """commit the current session's transaction""" |
264 """commit the current session's transaction""" |
265 if self.pool is None: |
265 if self.pool is None: |
266 assert not self.pending_operations |
266 assert not self.pending_operations |
267 self.transaction_data.clear() |
267 self.transaction_data.clear() |
268 self._touch() |
268 self._touch() |
|
269 self.debug('commit session %s done (no db activity)', self.id) |
269 return |
270 return |
270 if self.commit_state: |
271 if self.commit_state: |
271 return |
272 return |
272 # on rollback, an operation should have the following state |
273 # on rollback, an operation should have the following state |
273 # information: |
274 # information: |
305 """rollback the current session's transaction""" |
306 """rollback the current session's transaction""" |
306 if self.pool is None: |
307 if self.pool is None: |
307 assert not self.pending_operations |
308 assert not self.pending_operations |
308 self.transaction_data.clear() |
309 self.transaction_data.clear() |
309 self._touch() |
310 self._touch() |
|
311 self.debug('rollback session %s done (no db activity)', self.id) |
310 return |
312 return |
311 try: |
313 try: |
312 while self.pending_operations: |
314 while self.pending_operations: |
313 try: |
315 try: |
314 operation = self.pending_operations.pop(0) |
316 operation = self.pending_operations.pop(0) |