When perform sql insert?

前端 未结 1 1819
暗喜
暗喜 2021-01-26 10:07

I am using a VCL TCPServer components which fires events everytime a data is received on a tcp port. Within the event data is available into text parameter of the procedure. B

相关标签:
1条回答
  • 2021-01-26 10:51

    It's not really an answer to your question, but do consider the risk of your application failing (for any reason) between receiving the data and executing the INSERT.

    If you use a local store of some kind as an intermediate to mitigate this risk, consider the risk of a crash while that store is being updated.

    RDBMS vendors go to great lengths to ensure that data that has been accepted by successful completion of an INSERT, UPDATE or similar command will not be lost or corrupted. Can you put in similar effort?

    Generally speaking, if you are accepting data piecemeal rather than in bulk, I would probably keep an open connection to the database and insert data as you receive it, and only send an acknowledgement back to the consumer of your application once it has been pushed to the database.

    0 讨论(0)
提交回复
热议问题