Having multiple threads accessing a neo4j graph database concurrently is
what it's built for. This looks to be an issue with a lucene index.
java.nio.* is very sensitive to thread interrupts, but I've never seen this
exception before. Are you using Thread.interrupt() or some library that
might do that for controlling threads?

2011/9/28 st.pa <st...@web.de>

>
> hi,
>
> while i was not trying to use threads, everything went fine. now i need
> concurrent java threads to access the same (embedded?) graph database.
> neo4j-manual.pdf for 1.4.1 says in section 1.1.2. that i should use
> HighlyAvailableGraphDatabase, which is no longer there in 1.5.1 as it
> seems. i have not looked into server and rest api yet, so is there a way
> to do a threaded app with say a queue thread and n worker threads inside
> the jvm that all do their own transactions on the same database
> location? the following exception is what i got for assigning the queue
> thread's embedded db to the worker threads, i guess.
>
> Exception in thread "Thread-6" java.lang.RuntimeException:
> java.nio.channels.ClosedByInterruptException
> at
>
> org.neo4j.index.impl.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:603)
> at
>
> org.neo4j.index.impl.lucene.LuceneDataSource.getIndexSearcher(LuceneDataSource.java:486)
> at org.neo4j.index.impl.lucene.LuceneIndex.query(LuceneIndex.java:248)
> at
>
> org.neo4j.index.impl.lucene.LuceneIndex$RelationshipIndex.get(LuceneIndex.java:480)
> at de.stp.DatabaseNeo4j.removeUrlQueue(DatabaseNeo4j.java:777)
> at de.stp.util.BufferNeo4j.next(BufferNeo4j.java:194)
> at de.stp.RoboNeo4j.nächsterSchritt(RoboNeo4j.java:452)
> at de.stp.RoboNeo4j.run(RoboNeo4j.java:436)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.nio.channels.ClosedByInterruptException
> at
>
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
> at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:772)
> at
>
> org.apache.lucene.store.MMapDirectory$MMapIndexInput.<init>(MMapDirectory.java:225)
> at
>
> org.apache.lucene.store.MMapDirectory$MMapIndexInput.<init>(MMapDirectory.java:217)
> at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:209)
> at
>
> org.apache.lucene.index.CompoundFileReader.<init>(CompoundFileReader.java:66)
> at
>
> org.apache.lucene.index.CompoundFileReader.<init>(CompoundFileReader.java:55)
> at org.apache.lucene.index.IndexWriter.getFieldInfos(IndexWriter.java:1193)
> at
>
> org.apache.lucene.index.IndexWriter.getCurrentFieldInfos(IndexWriter.java:1213)
> at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1149)
> at
>
> org.neo4j.index.impl.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:590)
>        ... 8 more
>
> Thx for any ideas.
> ciao, st.p.
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to