Uploaded image for project: 'Corda'
  1. CORDA-1341

Provide access to database transactions for CorDapp developers

    Details

    • Feature Team:
      Experience and Production Readiness
    • Target Version/s:
    • Sprint:

      Description

      Currently CorDapp developers have access to Corda persistence via the flow framework and Corda services. However, it might be the case that some work needs to be performed on another thread. Trying to access `CordaPersistence` from another thread results in the following exception:

      Caused by: java.lang.IllegalStateException: Was expecting to find CordaPersistence set on current thread: Thread[RxIoScheduler-2,5,main]

      This is because there's no `ThreadLocal` instance of `CordaPersistence` available. It would be useful if there was an API for CorDapp developers to wrap vault calls etc. in a database transaction block. This would allow developers to perform tasks that require node database access in separate threads.

        Attachments

          Activity

            People

            • Assignee:
              removed86 Former user (Inactive)
              Reporter:
              Roger.Willis Roger Willis
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: