Before I go spelunking deeper into why my code sto...
# exposed
m
Before I go spelunking deeper into why my code stopped working when I update from
0.10.4
to
0.10.5
, does anyone here have theories as to why this update would fail? There are no changes in the code, just the version change. The failure is in integration tests that start with a clean database every time. This is on a MySQL instance:
Copy code
2018-09-19 16:41:39.502 [io-thread-1] INFO  Exposed - Transaction attempt #0 failed: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`authdb`.`Roles`, CONSTRAINT `Roles_ibfk_1` FOREIGN KEY (`orgId`) REFERENCES `Orgs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE). Statement(s): INSERT INTO Roles (name, orgId, permissions) VALUES (?, ?, ?);
INSERT INTO Roles (name, orgId, permissions) VALUES (?, ?, ?);
INSERT INTO Roles (name, orgId, permissions) VALUES (?, ?, ?);
INSERT INTO Roles (name, orgId, permissions) VALUES (?, ?, ?)
org.jetbrains.exposed.exceptions.ExposedSQLException: java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`authdb`.`Roles`, CONSTRAINT `Roles_ibfk_1` FOREIGN KEY (`orgId`) REFERENCES `Orgs` (`id`) ON DELETE CASCADE ON UPDATE CASCADE)
t
Could you provide a short sample to reproduce? And also which version of mysql driver do you use?
m
I’ll see if I can pull together a sample — the code’s a bit involved with other things.
We’re using mysql-connector-java 5.1.45