Spma retry transaction with certain types of error

Improve the working of spma in certain error conditions by retrying the transaction