We are using HSQLDB in an in-process (Tomcat/WebSphere) multi-thread situation where tables are being created, populated, queried and dropped very rapidly -- usually less than 5s in total. Each table is named uniquely, guaranteed. Each table also has a single compound index applied, and each table has a primary key auto generated via identity.
Infrequently, the create table fails with an "object already exists" error. In the catch block of that create, executing the identical create table script succeeds, in all cases.
In a sample run of 900 table creations (being generated by 10 threads in the pool), this occurred only 3 times. However, we can find no programmatic reason for it to occur at all.
Please provide a list of table names used. Is the name of a dropped table ever reused?
Datatablexxxx, where x is 0-9999, and then recycles to 0. It fails several
times prior to 1000, so there's no reuse. Logs do not indicate a problem in
the multithreading where the same xxxx is used twice by different threads,
and the catch block that executes directly after the exists exception is
uniformly successful in creating the same-named table. The error frequency
does seem to increase if the thread job time decreases, but that's
anecdotal.
Last edit: Fred Toussi 2017-03-11
Was this reproducible elsewhere?
We have not been able to reproduce this. Any test code could help.
Auto name generation has been made atomic to avoid any repeat names.