The client code that handles timeouts

After timeouts we need to make sure that active transactions, if any, are rolled back. All timeout handling must be done on the client. This post provides the implementation and unit tests. Implementation The following class extends SqlCommand and rolls back active transactions after timeouts: public static class SqlCommandExtentions { public static void ExecuteNonQueryWithErrorHandling ( this SqlCommand command ) { try { command.ExecuteNonQuery (); } catch ( SqlException e ) { HandleSqlException…(read more)