ENT-11620: Fixed to work with 4.12 class heirarchy.

This commit is contained in:
Adel El-Beik 2024-03-15 11:10:19 +00:00
parent 352931179a
commit 2bcb2ba945

View File

@ -30,6 +30,7 @@ import net.corda.core.internal.FlowStateMachine
import net.corda.core.internal.IdempotentFlow
import net.corda.core.internal.VisibleForTesting
import net.corda.core.internal.concurrent.OpenFuture
import net.corda.core.internal.cordapp.CordappProviderInternal
import net.corda.core.internal.isIdempotentFlow
import net.corda.core.internal.location
import net.corda.core.internal.telemetry.ComponentTelemetryIds
@ -320,7 +321,7 @@ 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
Thread.currentThread().contextClassLoader = serviceHub.cordappProvider.appClassLoader
val threadLocal = transientValues.database.hikariPoolThreadLocal
if (threadLocal != null) {
val valueFromThread = swappedOutThreadLocalValue(threadLocal)