java.lang.IllegalStateException: Was expecting to find transaction set on current strand

你说的曾经没有我的故事 提交于 2019-12-12 10:26:09

问题


In Corda, I am running flow tests using a MockNetwork. I am trying to retrieve a transaction from one of the nodes' transaction storage using:

node.services.validatedTransactions.getTransaction(signedTx.id)

However, this is throwing the following exception:

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalStateException: Was expecting to find transaction set on current strand: Thread[main,5,main]

What is the cause of this error?


回答1:


Whenever you need to access a MockNode's database, you need to do so inside a database transaction:

node.transaction {
    node.services.validatedTransactions.getTransaction(signedTx.id)
}


来源:https://stackoverflow.com/questions/53279358/java-lang-illegalstateexception-was-expecting-to-find-transaction-set-on-curren

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!