插入数据时,经常会显示Table Busy。错误消息为:
Exception in thread "pool-3-thread-1" org.springframework.jdbc.UncategorizedSQLException:
Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: table busy [reason=insert]
The error may involve com.secusoft.mapper.quest.CameraAccessDetailsMapper.insert-Inline
The error occurred while setting parameters
SQL: insert into camera_access_details_1_20211016 values (72, to_timestamp('2021-10-16 22:06:00','yyyy-MM-dd HH:mm:ss'),to_timestamp('2021-10-16 22:07:00','yyyy-MM-dd HH:mm:ss'), 0, 0)
Cause: org.postgresql.util.PSQLException: ERROR: table busy [reason=insert]
; uncategorized SQLException for SQL []; SQL state [00000]; error code [0]; ERROR: table busy [reason=insert]; nested exception is org.postgresql.util.PSQLException: ERROR: table busy [reason=insert]
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84)
...
发布于 2021-10-22 12:01:40
当您使用Postgress connection协议将数据插入到QuestDB中时,写入被强制为单线程。如果同时发生多个写入,则会将table busy
错误发送回客户端。
你可以使用REST api,它将自动重试插入,或者ILP,它允许同时从多个连接插入。
https://stackoverflow.com/questions/69671241
复制相似问题