Last answered:

01 Mar 2023

Posted on:

06 Jul 2022

23

The ROLLBACK not working according to step-by-step class

So, I already found a solution to the problem, I only couldn't fit the understanding on why (yet) I have to do what I am doing in order for it to work properly. I figure it could be helpful to post it here so the video could be edited in order to include the extra step, if really necessary. Maybe it is a feature of new versions of MY SQL, which was not necessary back when the original video was made.

In a nutshell, ROLLBACK didn't work, unless I used:

set autocommit = 0;

Apparently, it disables the autocommit in My SQL, which should have been done only according to what is told in the video.

5 answers ( 0 marked as helpful)
Instructor
Posted on:

14 Jul 2022

0

Hi Rafael!
Thanks for reaching out.

I am glad that you have resolved your issue. Thanks for sharing this piece of information with the Community!

Best,
Tsvetelin

Posted on:

18 Nov 2022

0

Thanks! They should  most definitely add this to the lecture

Posted on:

19 Nov 2022

3

Thank you so much! I also had the same problem. I had to do the following:

1. SET AUTOCOMMIT=0;
2. DROP TABLE departments_dup;
3. CREATE TABLE departments_dup;
4. INSERT INTO departments_dup the values from departments;
5. COMMIT;
6. UPDATE departments_dup;
7. ROLLBACK;

And that is how I got the exercise to work.

Posted on:

26 Nov 2022

0

I had the same problem as others here. the step-by-step instructions in the video did not work. I had to do the steps shared by Jannery Rivas before I was able to get it to work as intended.

Posted on:

01 Mar 2023

1

Hello everyone,


I found out that I had the "auto commit mode" on, after I turn it off, it worked.


Edit>Preferences>SQL Executions> untick "New connections use auto commit mode".


Thank,

Andrei

Submit an answer