-
We've had a few instances when using the activity log where a SQL Serialization failure exception has been thrown.
caused when trying to insert into the
I realise I need to investigate the ultimate cause of the deadlock, but for now to avoid losing audit log entries I want to catch the exception and retry the insert - what would be the best way to do this? I'm still reading through the code so I may well be able to answer my own question soon... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This is more a database than a code problem. Which database and table engine do you use? I would like to pull in @tpetry as he knows more about databases. But so far I get it a switch to an unordered UUID primary key index and dropping the auto increment could solve your issue. All this is supported by the package as you can customize the migrations and use your own model. |
Beta Was this translation helpful? Give feedback.
This is more a database than a code problem. Which database and table engine do you use?
As most common is MySQL with InnoDB: https://dev.mysql.com/doc/refman/5.7/en/innodb-locking.html
I would like to pull in @tpetry as he knows more about databases. But so far I get it a switch to an unordered UUID primary key index and dropping the auto increment could solve your issue.
All this is supported by the package as you can customize the migrations and use your own model.