2

Table Busy is often displayed when data is inserting. The error message is:

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)
...
Learzhu
  • 21
  • 1

1 Answers1

0

When you use Postgress connection protocol to insert data into QuestDB writing is forced to be single threading. If multiple writes happen at the same time, table busy error is sent back to the client.

You can use REST api which will auto retry inserts or ILP which allow to insert from multiple connections simultaneously.

Alex des Pelagos
  • 1,170
  • 7
  • 8