def __exit__(self, exc_type, exc_value, exc_tb):
        """Commit a transaction upon Context Manager exit

        Upon exit, the transaction will attempt to be committed. If the commit
        fails, the transaction will automatically be rolled back by the server
        performing the transaction.

        :param exc_type: The type of exception raised
        :param exc_value: Value of the exception raised
        :param exc_tb: Traceback
        NOTE: If the context exits without an exception, all three of the
        parameters will be None
        :returns: void
        """

        self.icr.session.headers = dict()
        if exc_tb is None:
            try:
                self.transaction.modify(state="VALIDATING",
                                        validateOnly=self.validate_only)
            except Exception as e:
                logging.debug(e)
                raise TransactionSubmitException(e)
            finally:
                self.icr.session.headers = self.original_headers
        self.icr.session.headers = self.original_headers
def __exit__ ( self , exc_type , exc_value , exc_tb ) : self . icr . session . headers = dict ( ) if exc_tb is None : try : self . transaction . modify ( state = "VALIDATING" , validateOnly = self . validate_only ) except Exception as e : logging . debug ( e ) raise TransactionSubmitException ( e ) finally : self . icr . session . headers = self . original_headers self . icr . session . headers = self . original_headers
Commit a transaction upon Context Manager exit

        Upon exit, the transaction will attempt to be committed. If the commit
        fails, the transaction will automatically be rolled back by the server
        performing the transaction.

        :param exc_type: The type of exception raised
        :param exc_value: Value of the exception raised
        :param exc_tb: Traceback
        NOTE: If the context exits without an exception, all three of the
        parameters will be None
        :returns: void