Why is rollback not working? (using InnoDB)
Posted by: Vincentius Kevin
Date: April 23, 2016 07:14AM

In MySQL Workbench I created a model with a few tables and use forward engineer to generate the SQL code to create the database. The Table Inspector of the MySQL Workbench confirms that InnoDB engine is used for every table.

Then I used JDBC in my Java code, I called con.setAutoCommit(false) and never call con.commit(), but it seemed as if auto commit is still on. Any idea what is causing my problem here? Thanks!

The relevant code is here:

Simply put, this is what happened:
1. A few insert statements
2. con.rollback(); (the output "Testing abort! ....." was produced, confirming this)
3. The inserted data stayed on the database, which is the problem.

Options: ReplyQuote

Written By
Why is rollback not working? (using InnoDB)
April 23, 2016 07:14AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.