transaction commit on success causing deadlock on mysql