There was an error in my code, I fixed it.
Now I am not getting errors on client side, but BaseX is not persisting all documents that I inserted.
I created 20 BaseXClient's, 10 threads to take BasXClient from a LinkedBlockingQueue, each thread was
responsible to insert 1000 documents, total of documents 10 x 1000 = 10K, however was inserted 9801.
Regards
Hi Willian,
thanks for your mail. I would assume that one single BaseXClient
object was used for several concurrent tasks. As BaseXClient objects
are very light-weight, and as the registration of new clients is
usually more than fast enough, the usual approach is to create a new
BaseXClient instance for a dedicated action.
Hope this helps,
Christian
_______________________________
> _______________________________________________
> I builded a kind of connection pool using BaseXClient.java class, I
> simulated several users trying insert documents in BaseX,
> the result was a disaster.
> ERROR: data.BaseXDataAccess - Error closing db
> java.io.IOException: Stopped at line 1, column 19:
> Unknown command: 1340477810253095000. Try HELP.
> at data.BaseXClient.execute(BaseXClient.java:99)
> at data.BaseXClient.execute(BaseXClient.java:110)
> at data.BaseXDataAccess.save(BaseXDataAccess.java:169)
> at data.TestInsert$Insert.run(TestInsert.java:88)
> at java.lang.Thread.run(Thread.java:680)
> Exception in thread "Thread-1" java.lang.RuntimeException:
> java.io.IOException:
> at data.BaseXDataAccess.save(BaseXDataAccess.java:164)
> at data.TestInsert$Insert.run(TestInsert.java:88)ERROR:
> com.xftec.hyperion.data.BaseXDataAccess - Error closing db
>
> I started several threads each one takes a BaseXClient connection and as
> soon as it finishs its job BaseXClient is put in a
> queue again to be took by other thread.
>
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>