potiuk edited a comment on pull request #18453: URL: https://github.com/apache/airflow/pull/18453#issuecomment-925729971
> Given the next statement is return, and thus that active Session will be closed, the commit here is entirely redundant -- the session will be cleaned up and any the transactions will be rolledback. > > So what this will actually do is: > > `COMMIT` (from the `commit()`) > `BEGIN` (because session.autocommit is `False` so there is _always_ an active transaction as long as there is a session in scope) > `ROLLBACK` (because the session goes out of scope, gets gc'd and closed.) Yep. I agree it's not needed, and It certainly works like that, so from performance point of view it is 'slightly` better to remove, and I am not at all against removing it, i just want to see if it bothers others from "reasoning" point of view. I even initially implemented it without the commit, but when I looked at the PR after I pushed it - my internal policeman told me "let's make it consistent" and I pushed a changed commit. But if it's just me who is bothered by that - I am perfectly OK to leave it like htat. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
