We have an application where we need to do some high-performance operations 
so we do them in batches in multiple threads.

There are some objects that we would like to cache in a LoadingCache and 
use them in all the threads without having to get them again and again from 
the database.
The problem with this is that neo4j driver is not allowing to share an 
object between sessions, even when that object is not going to be changed 
at that point. The error we are getting is:


   - Exception on sync: org.neo4j.driver.v1.exceptions.ClientException: You 
   are using a session from multiple locations at the same time, which is not 
   supported. If you want to use multiple threads, you should ensure that each 
   session is used by only one thread at a time. One way to do that is to give 
   each thread its own dedicated session.


Is there a way we can accomplish this without having to reload the object 
from db again and again in each thread (so they use a different session)?
 
Thanks,
Matias.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to