`No transaction in context` error when running a flow

放肆的年华 提交于 2021-01-28 08:53:20

问题


When running a Corda flow, I receive the following error:

java.lang.IllegalStateException: No transaction in context

How can I solve this issue?


回答1:


This issue is likely caused by a failure to annotate a function called from within a flow with the @Suspendable annotation. This could either be FlowLogic.call, or a function called from within FlowLogic.call (e.g. SignTransactionFlow.checkTransaction if you are overriding this function as part of a call to CollectSignaturesFlow).

If you run flow tests with the following command line flag:

-Dco.paralleluniverse.fibers.verifyInstrumentation=true

Then the missing annotation will be highlighted if it causes an error. However, this will slow down the running of the tests.



来源:https://stackoverflow.com/questions/48302454/no-transaction-in-context-error-when-running-a-flow

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