Hi all,
Thanks for the help with the multiple user on the embedded problem, I'm
still getting the exception(I am a little rusty at working with threads). So
I run the tread when wanting to work with the db and then in a do/while
statement check if complete(if so yield). But when a second user tries to
access from another browser/computer I get the dreaded exception(see below).
Any suggestions/workarounds would be great! Or an example of where people
have used threads in interacting with neo4j.
Regards,
John.

RPC server side code:
processAStar = new ProcessAStarAlgorithm(latitude1, longitude1, latitude2,
longitude2, desiredDistance);
boolean processing = true;
Thread runner = new Thread(){
public void run(){
processAStar.configureSearch();//create the graph db and process
calculations
System.out.println("Running thread");
}
};
runner.start();
do {
try {
Thread.sleep(1000);
System.out.println("Sleeping thread");
if(processAStar.calculationComplete==true){
System.out.println("Calculation complete in thread");
sp = processAStar.getShortestPathRepresentation();
processing = false;
Thread.yield();
}
} catch (InterruptedException exc) {
}
} while (processing);
return sp;

Exception:
Exception in thread "Thread-21"
org.neo4j.graphdb.TransactionFailureException: Could not create data source
[nioneodb], see nested exception for cause of error
at
org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModule.java:154)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:107)
at org.neo4j.kernel.EmbeddedGraphDbImpl.<init>(EmbeddedGraphDbImpl.java:168)
at
org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:81)
at
org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:65)
at
com.routeplanner.fyp.pathfinder.ProcessAStarAlgorithm.getWaypointsClose(ProcessAStarAlgorithm.java:72)
at
com.routeplanner.fyp.pathfinder.ProcessAStarAlgorithm.configureSearch(ProcessAStarAlgorithm.java:307)
at
com.routeplanner.fyp.server.PlanRouteServiceImpl$1.run(PlanRouteServiceImpl.java:22)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.neo4j.kernel.impl.transaction.XaDataSourceManager.create(XaDataSourceManager.java:74)
at
org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModule.java:148)
... 7 more
Caused by: java.lang.IllegalStateException: Unable to lock store
[C:\fyp_2.011\neo4j-db\neostore], this is usually caused by another Neo4j
kernel already running in this JVM for this particular store
at
org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.checkStorage(CommonAbstractStore.java:266)
at
org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.<init>(CommonAbstractStore.java:163)
at
org.neo4j.kernel.impl.nioneo.store.AbstractStore.<init>(AbstractStore.java:120)
at org.neo4j.kernel.impl.nioneo.store.NeoStore.<init>(NeoStore.java:64)
at
org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.<init>(NeoStoreXaDataSource.java:128)
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to