serg Maybe right in the server then? Then it will be everywhere, and server better knows what reasons are temporary(to track if new such error emerge), at least.
Does it feel like that is something belonging to C/C for you? I am not sure.
Also I am not sure about details. Like what if transaction fails again? Repeat till some till some time before some timeout? or some special timeout? or for configurable number of times? and what if it still fails? some new special error or same error? what if errors were different(I don't know if that is possible, ). Does it have to be applied to all transactions on the connection? Does it have to be applied to all such temporary reasons or to the configurable list of reasons. Also, different reasons might need different auto-replying pattern, like if we have deadlock, period of re-sending of commit should be somehow depend on the related server timeouts.
Well, most of the questions can be answered by "keep it simple" and at the end we will have smth like
if (error in <the_list_of_temporary_reasons>)
while (<replay_number_option>-- > 0) mysql_commit(conn_handle);
it seems that the appropriate name should be "auto-retrying of transactions" or "auto-replaying".
And likely it should be implemented in Connector/C, where Connector/C++ would just invoke it from there.
Lawrin, thoughts?