mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
ENT-11620: Set the thread context class loader so all fibres involved in a flow has the thread context class loader set to the app class loader.
This commit is contained in:
parent
4faa0caeb3
commit
99faeaf667
@ -320,6 +320,9 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun openThreadLocalWormhole() {
|
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
|
val threadLocal = transientValues.database.hikariPoolThreadLocal
|
||||||
if (threadLocal != null) {
|
if (threadLocal != null) {
|
||||||
val valueFromThread = swappedOutThreadLocalValue(threadLocal)
|
val valueFromThread = swappedOutThreadLocalValue(threadLocal)
|
||||||
|
Loading…
Reference in New Issue
Block a user