Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all articles
Browse latest Browse all 884

Why is rollback not working? (using InnoDB) (no replies)

$
0
0
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:
http://pastebin.com/zY8MXrBN

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.

Viewing all articles
Browse latest Browse all 884

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>