The point of the post was to try and determine why the battery sparked the first time i connected the cables, then it sparked and the engine tried to turn over the second time i connected the cables even though the bike was off and the key not in the ignition.
Well as i cannot see the bike i dont know if you have knocked or done something wrong with the wires.... What bike is it ?
Gilera DNA 125cc. The only wires that i touched while i was working on it there were disconnecting the battery leads and the four fuses located behind the battery. Fuses were removed, leads were disconnected, battery was removed, fuse box and attached cables along with the battery leads were slid under the frame so they were out the way of the work I was doing. When putting the stuff back on again it was done in reverse order. Theres no nicks on any of the wires or cables that I can see and none of them are jammed in anywhere causing a pinch or anything that I can tell.
Well to be honest, i cant really help anymore, If it was fine before and as you said before it was. Then it obviously is something you have done. If i was you i would take all the pannels off and check every wire because obviously something is not right.