【发布时间】:2014-01-20 01:51:16
【问题描述】:
我想知道我是否可以在 Akka Futures 中使用 tinkerpop,到目前为止,当我将更改提交到图表时,它们不会被持久化。
我知道 tinkerpop 是一个线程本地库,这意味着我需要在未来再次设置我的线程ODatabaseRecordThreadLocal.INSTANCE.set(thread)
我尝试了以下方法但没有成功:
def test[T](graphChanges: => T): T = {
val thread = ODatabaseRecordThreadLocal.INSTANCE.get
try graphChanges finally {
ODatabaseRecordThreadLocal.INSTANCE.set(thread)
GraphPool.get("partitioned").commit
}
}
// collect tinkerpop frames
test {
future {
// add changes to my tinkerpop frames
}
}
我希望每个 play.mvc.Http.Context 都有 Tinkerpop 线程
这是一个我想要实现的示例项目:https://github.com/D-Roch/tinkerpop-play
【问题讨论】:
标签: scala playframework-2.0 akka thread-local tinkerpop