what I mean is that the logic to identify whether the error is due to a deadlock should be in the driver itself (which would allow to implement it in other drivers too, not only for MySQL), not in the ORM.