Hi,
I'm new to
Java and I wrote a little code yesterday which executes some INSERT-Statements on a MySQL-Database via
JDBC.
While
testing the code I found out the rollback I had in the catch-block didn't work.
To analyze this issue, I made things simple and wrote the following code:
First, I get the highest value of the "num"-column and increase it by 1 for the INSERT.
Then the INSERT-Statement is executed and the content of the table is displayed. Although no commit was made, the SELECT-Command returns the line I've just inserted, so it seems that "setAutoCommit(false)" doesn't work.
The following rollback doesn't change anything, but I assume that's not the problem, because somehow the INSERT-Statement was yet commited.
Does anybody has an idea what's wrong here?
The transaction isolation level in the database is set to "REPEATABLE READ", do I have to change this to be able to set off AutoCommit?
Thanks for your help!
Marco