You have a lot of alternatives:
Disable button and wait some time to enable again
Disable button, wait response from server, show success dialog, wait for user to click close, then enable button again
You can check if the same data was inserted before in a defined amount of time and cancel the operárion