Ich verwende Titan Transaktions-API, um Transaktionen in meinem Code zu behandeln. Es funktioniert gut,Probleme bei der Behandlung von asynchronen Transaktionen in TitanDB mit Scala Future
hier ist mein Code:
Synchrone Übertragung:
def syncTransaction()={
val transaction = titanGraph.newTransaction
// doing some modification and query , creation vertex
transaction.commit()
}
ich oben Methode für 1000 anzurufenden Rekord persistence.It fein arbeitet.
Asynchronous Transaktion:
def aysncTransaction()= Future{
val transaction = titanGraph.newTransaction
// doing some modification and query , creation vertex
transaction.commit()
}
oben Code Wenn in Scala Zukunft (Scala Zukunft verwendet für nicht blockierende und asynchrone Codeausführung) gewickelt ist es wirft folgende Ausnahme:
[ERROR] - [2016-05-16 14:01:04,849] - [com.thinkaurelius.titan.graphdb.database.StandardTitanGraph] Could not commit transaction [2] due to exception
com.thinkaurelius.titan.diskstorage.locking.PermanentLockingException: Local lock contention
at com.thinkaurelius.titan.diskstorage.locking.AbstractLocker.writeLock(AbstractLocker.java:313) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.diskstorage.locking.consistentkey.ExpectedValueCheckingStore.acquireLock(ExpectedValueCheckingStore.java:89) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSProxy.acquireLock(KCVSProxy.java:40) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.diskstorage.BackendTransaction.acquireIndexLock(BackendTransaction.java:240) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.prepareCommit(StandardTitanGraph.java:554) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.commit(StandardTitanGraph.java:683) ~[titan-core-1.1.0-SNAPSHOT.jar:na]
at com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx.commit(StandardTitanTx.java:1352) [titan-core-1.1.0-SNAPSHOT.jar:na]
at com.freebird.titan.connect.GraphFactory$class.withTransaction(GraphFactory.scala:25) [classes/:na]
at com.freebird.oag.ingestion.TitanDBPersistentActorImpl.withTransaction(TitanDBPersistentActor.scala:25) [classes/:na]
at com.freebird.titan.connect.GraphFactory$$anonfun$withAsyncTransaction$1.apply(GraphFactory.scala:17) [classes/:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) [scala-library-2.11.7.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) [scala-library-2.11.7.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
kann jeder Bitte sag mir, was ich hier falsch mache. Jede Hilfe wird geschätzt. Danke