Auto-retry transactions in case of lock-waits and dead-locks