MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _transactional

Method _transactional

pydevd_attach_to_process/winappdbg/sql.py:290–313  ·  view source on GitHub ↗

Begins a transaction and calls the given DAO method. If the method executes successfully the transaction is commited. If the method fails, the transaction is rolled back. @type method: callable @param method: Bound method of this class or one of its subcl

(self, method, *argv, **argd)

Source from the content-addressed store, hash-verified

288 self._session = session
289
290 def _transactional(self, method, *argv, **argd):
291 """
292 Begins a transaction and calls the given DAO method.
293
294 If the method executes successfully the transaction is commited.
295
296 If the method fails, the transaction is rolled back.
297
298 @type method: callable
299 @param method: Bound method of this class or one of its subclasses.
300 The first argument will always be C{self}.
301
302 @return: The return value of the method call.
303
304 @raise Exception: Any exception raised by the method.
305 """
306 self._session.begin(subtransactions=True)
307 try:
308 result = method(self, *argv, **argd)
309 self._session.commit()
310 return result
311 except:
312 self._session.rollback()
313 raise
314
315
316# ------------------------------------------------------------------------------

Callers 1

TransactionalFunction · 0.80

Calls 2

beginMethod · 0.80
methodFunction · 0.50

Tested by

no test coverage detected