You need to always set the dog up for success. For 2 years you have been setting your dog up to fail and he has been happily self reinforcing by jumping at the horse.
A dog trained by someone who really understands this sytem will have no higher value that working for its handler. This is achieved by the building and transferrance of value combined with understanding the capturing and reinforcement of behaviours and teaching the dog to work operantly.
So for most of us is a mix of techniques including the occasional postive punishment as you did is probably always going to work better. However one must always be aware of not using positive punishment out of frustration as you did and we probably all have done at some stage. If something is not working dont let it go for 2 years. Revaluate what you are doing and why it is not working.