Your application has the ability to handle Ctrl C and Ctrl Break , like keystrokes or signals (depending on configuration), which means the application has the ability to make a clean exit, these would be a much softer way to terminate the process, allowing it a little longer execution time, if nothing else.
TerminateProcess is more like a blow in the teeth, the application cannot handle it, it comes from the kernel, and if the application can process it, it will create all kinds of problems with the "un killable" processes, which depend on the TerminateProcess handler and refused to exit.
As I understand it, as soon as the TerminateProcess is called in the process, it cannot execute more code that it has, doesn’t clear, does not exit, just finished, you cannot process it, it just doesn't make sense if you couldn’t safety point of view.
An excellent code draft article is here for handling Windows console signals:
http://www.codeproject.com/KB/winsdk/console_event_handling.aspx
By implementing some of the above actions with signals, you can make sure that the database record has a chance to complete before the program is released, and not, perhaps, leave it to its own devices.
You can block TerminateProcess, but its "not very" polite "programming, it is more like root set programming, I saw a good article about it on rootkit.com, so look for the" Invincibility Process "there, when you have an invincible process, it could turn off in due time after receiving such a “request” and perform any cleanup before hnad, but this will certainly be a hack.
It seems to me that the behavior of Ctrl C that you see now is due to the fact that it does not immediately end the current process.