reactiverse / es4x

🚀 fast JavaScript 4 Eclipse Vert.x
https://reactiverse.io/es4x/
Apache License 2.0
881 stars 75 forks source link

mongo-client:Multi threaded access requested by thread Thread[] but is not allowed for language(s) js #601

Open darrenweb opened 1 year ago

darrenweb commented 1 year ago

Hi I use vertx-mongo-client in es4x to save data. npm start and open the browser, if i just refresh the browser once (send a request), the data will be saved to mongodb normally, and there is no abnormal prompt, but if i refresh the browser quickly twice (send 2 requests ), the following error will be prompted, and the data has not been saved to mongodb. The following is the code, what do I need to do so that multiple requests can still be saved in the mongodb?

Thanks!

20230418105005

pmlopes commented 1 year ago

This is a issue with the underlying client that isn't properly isolated. While in Java this usually isn't a problem, graal-js is very strict and will not allow it. There isn't anything we can do in es4x except hoping that the upstream client is proerly isolated.

it-solution-div3 commented 1 year ago

Is this a problem caused by the design of vertx-mongo-client.jar, and if vertx-mongo-client.jar is rewritten, can this problem be solved theoretically? Thanks!