def __call__(self, function, *args, **kwargs):
for wait_in_seconds in self.backoff_generator():<EOL><INDENT>try:<EOL><INDENT>if self.do_quit_check:<EOL><INDENT>self.quit_check()<EOL><DEDENT>with self.db_conn_context_source() as connection:<EOL><INDENT>try:<EOL><INDENT>result = function(connection, *args, **kwargs)<EOL>connection.commit()<EOL>return result<EOL><DEDENT>except:<EOL><INDENT>connection.rollback()<EOL>raise<EOL><DEDENT><DEDENT><DEDENT>except DBApiUtilNonFatalBaseException:<EOL><INDENT>raise<EOL><DEDENT>except self.db_conn_context_source.conditional_exceptions as x:<EOL><INDENT>if not self.db_conn_context_source.is_operational_exception(x):<EOL><INDENT>self.config.logger.critical(<EOL>'<STR_LIT>',<EOL>self.connection_source_type,<EOL>exc_info=True<EOL>)<EOL>raise<EOL><DEDENT>self.config.logger.critical(<EOL>'<STR_LIT>',<EOL>self.connection_source_type,<EOL>exc_info=True)<EOL><DEDENT>except self.db_conn_context_source.operational_exceptions as x:<EOL><INDENT>self.config.logger.critical(<EOL>'<STR_LIT>',<EOL>self.connection_source_type,<EOL>exc_info=True)<EOL><DEDENT>self.db_conn_context_source.force_reconnect()<EOL>self.config.logger.debug(<EOL>'<STR_LIT>' % wait_in_seconds<EOL>)<EOL>self.responsive_sleep(<EOL>wait_in_seconds,<EOL>'<STR_LIT>' %<EOL>self.connection_source_type,<EOL>)<EOL><DEDENT>raise<EOL>
execute a function within the context of a transaction