| Bug #89334 | Insert not rollbacked in transaction when ObjectOptimisticLockingFailureExceptio | ||
|---|---|---|---|
| Submitted: | 20 Jan 2018 10:56 | Modified: | 7 Feb 2018 16:59 |
| Reporter: | Martin Tlachac | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | Ver 14.14 Distrib 5.7.20, for Linux (x86 | OS: | Ubuntu (16.04) |
| Assigned to: | Chiranjeevi Battula | CPU Architecture: | Any |
| Tags: | rollback insert transaction | ||
[20 Jan 2018 10:56]
Martin Tlachac
[22 Jan 2018 9:57]
Martin Tlachac
I think it is actually quite serious
[7 Feb 2018 9:32]
Chiranjeevi Battula
Hello Martin Tlachac, Thank you for the bug report. Could you please provide repeatable test case (exact steps, C/Java version, full stack trace, sample code etc. - please make it as private if you prefer) to confirm this issue at our end? Thanks, Chiranjeevi.
[7 Feb 2018 12:03]
Martin Tlachac
https://github.com/tlachy/BugDb89334 see readme
[7 Feb 2018 16:59]
Filipe Silva
Hi Martin,
Thanks for your interest in MySQL and Connector/J.
The rollback statement isn't doing what you are expecting. If you run the same directly in a mysql client you'll see this:
mysql> rollback;
Query OK, 0 rows affected, 1 warning (0,00 sec)
mysql> show warnings;
+---------+------+---------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1196 | Some non-transactional changed tables couldn't be rolled back |
+---------+------+---------------------------------------------------------------+
This is so because you are using MyISAM tables, which don't support transactions. Take for example the create statement for the account table:
2018-02-07T15:33:22.812452Z 4 Query create table account (
id bigint not null auto_increment,
balance decimal(19,2),
version bigint not null,
primary key (id)
) engine=MyISAM
You should make amends in your application in order to create InnoDB tables instead. I can't help you here, though.
For now I'm closing this report as not a bug. If you still see some unexpected behavior after fixing your application, then please reopen it or file a new one. Thank you.
I hope this helps.
