Merge pull request #7688 from corda/adel/ENT-11620

ENT-11620: Set the thread context class loader so all fibres involved…
This commit is contained in:
Adel El-Beik 2024-03-13 17:22:49 +00:00 committed by GitHub
commit a6ee0e940a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -320,6 +320,9 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
}
private fun openThreadLocalWormhole() {
// This sets the Cordapp classloader on the contextClassLoader of the current thread.
// Needed because in previous versions of the finance app we used Thread.contextClassLoader to resolve services defined in cordapps.
Thread.currentThread().contextClassLoader = (serviceHub.cordappProvider as CordappProviderImpl).cordappLoader.appClassLoader
val threadLocal = transientValues.database.hikariPoolThreadLocal
if (threadLocal != null) {
val valueFromThread = swappedOutThreadLocalValue(threadLocal)