I'm new on graph databases and back-end programming in general.
I have a query to create a vertex, If I send the query multiple times simultaneously to get multi-threading performance I get NullPointerException when reading the created vertices in another query later.
If I send the same query one at a time without multi threading everything works perfectly.
I was told JanusGraph is thread safe for reading and writing that is why I'm using it.
This is my query:
g.withSideEffect('nothing', [])
.inject(objectsReadyForDB)
.unfold()
.map(
__.as('data')
.select('userId')
.as('dap')
.select('data')
.choose(
__.V()
.hasLabel(verticesLabel)
.has('userId', __.where(P.eq('dap'))),
__.select('nothing'),
__.addV("user"),
),
)
.unfold();
It seems the choose() part is causing the issue, If I remove that it also works.