TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

inserting two records simultaneously

Open march3008 opened this issue 6 years ago • 3 comments

第一个插入回调没有回复, 第二条插入可能会失败 01/06 23:15:12.969768 7f54433ec700 SDD: daedUdpRecvDataSaveCallBack----------- 01/06 23:15:12.970184 7f54433ec700 SDD: insertDeviceTable sql=INSERT INTO arc_device_02020000009019 VALUES (1578381312970 , 1259.0000,'2018-12-25 09:50:05', 23, 9571, 362.0000, 0, 55, 19,'00000000000000000000000000000000', 22, -214748.1094, 2.5200,'ff','333539333639303832343332373632','343630313133303134313337393638', 0, 1, 6, 9,'eb040000eb040000eb040000eb040000eb040000eb040000eb040000eb040000eb040000') 01/06 23:15:12.970521 7f54433ec700 SDD: daedUdpRecvDataSaveCallBack----------- 01/06 23:15:12.970889 7f54433ec700 SDD: insertDeviceTable sql=INSERT INTO arc_device_02020000009019 VALUES (1578381312970 , 1259.0000,'1412-12-19 09:32:05', 23, 9571, 362.0000, 0, 37, 19,'00000000000000000000000000000000', 22, -214748.1094, 2.5200,'ff','333539333639303832343332373632','343630313133303134313337393638', 0, 1, 6, 9,'eb040000eb040000eb040000eb040000eb040000eb040000eb040000eb040000eb040000') 01/06 23:15:12.970815 7f5441447700 SDD ERROR: buildTableCallBack:0x55f6084b3010, success, code:1 01/06 23:15:12.971549 7f5441c48700 SDD ERROR: buildTableCallBack:0x55f6084b3010, failed, affect rows:0

march3008 avatar Jan 07 '20 07:01 march3008

You use the asynchronous API?

hjxilinx avatar Jan 07 '20 08:01 hjxilinx

yes

march3008 avatar Jan 07 '20 08:01 march3008

You should not invoke another insert procedure until previous insertion is completed, and your callback function is invoked. The NEXT insertion should only be called during you callback function. I noticed that your last two records own the identical timestamp, which means the last one will never be inserted into database.

hjxilinx avatar Jan 07 '20 08:01 hjxilinx