def rollback(self):
self._check_thread()<EOL>if self.state not in (_STATE_ACTIVE, _STATE_PARTIAL_COMMIT):<EOL><INDENT>raise TransactionError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>if self.state != _STATE_PARTIAL_COMMIT:<EOL><INDENT>request = transaction_rollback_codec.encode_request(self.id, self.thread_id)<EOL>self.client.invoker.invoke_on_connection(request, self.connection).result()<EOL><DEDENT>self.state = _STATE_ROLLED_BACK<EOL><DEDENT>finally:<EOL><INDENT>self._locals.transaction_exists = False<EOL><DEDENT>
Rollback of this current transaction.