SQL bad insertion
FixedDev opened this issue ยท 3 comments
As known by lots of previous issues, there's a data race when multiple saves are being done. This could be fixed by using INSERT... ON DUPLICATE KEY UPDATE
on MySQL and INSERT OR REPLACE INTO
in SQLite.
The downside of this is that MySQL and SQLite queries would be different, but that would solve the problem.
Thanks for bringing this up, but the plugin acquires a lock on the data model. Outside of multiple BungeeCords this would be then safe to do.
I guess you used an outdated version where this wasn't case. We had Replace INTO
a while ago.
159da4c. However this would always create a new entry, which is not really great way to handle that. The motivation is missing from that commit (Nowadays I would be smarter), but it was that in combination with auto incrementing keys we potentially run out of entries faster for not really having any benefit. It's the same player, so we could use the same row entry.