Oracle turns off auto commit to drop temporary table#17756
Oracle turns off auto commit to drop temporary table#17756losipiuk merged 1 commit intotrinodb:masterfrom
Conversation
425202f to
be38003
Compare
There was a problem hiding this comment.
this is the last operation on connection - why switch back?
There was a problem hiding this comment.
I think this is answered by my most recent response in the other thread
There was a problem hiding this comment.
what is the motivation behind the change? Should we commit explicitly then? Or was switching auto-commit back to true just before connection is closed for that?
There was a problem hiding this comment.
Please add a comment below - or just call commit() - will be more readable I think
There was a problem hiding this comment.
The motivation is that, because autoCommit is true when we get the Connection, the lock is immediately released because that LOCK TABLE statement is auto-committed, so the Connection has to re-acquire the lock for the DROP TABLE, so we have the same situation as we did before. Turning off auto commit holds onto that lock until after the drop table. Oracle's docs say DDL always auto-commits, but I reset autoCommit to true after the drop just in case.
be38003 to
397c9f5
Compare



Description
This is hopefully the final battle with Oracle to drop our temporary tables correctly, related to #16277
In my last PR, I forgot about the whole concept of auto commit. The result was the lock we acquired before the drop table was immediately released and had no effect.
Additional context and related issues
Release notes
(X) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: