mirror of
https://github.com/corda/corda.git
synced 2025-04-13 06:03:13 +00:00
Merge pull request #7856 from corda/cc/dev/os/4.12/ent-12154/mocknetwork_leak
ENT-12154 - Remove Hibernate sessions when done with them
This commit is contained in:
commit
7852754ad9
@ -101,6 +101,7 @@ dependencies {
|
||||
}
|
||||
|
||||
implementation "co.paralleluniverse:quasar-core:$quasar_version"
|
||||
implementation "org.hibernate:hibernate-core:$hibernate_version"
|
||||
}
|
||||
|
||||
compileJava {
|
||||
|
@ -83,6 +83,7 @@ import java.time.Clock
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
import org.hibernate.internal.SessionFactoryRegistry
|
||||
import kotlin.io.path.createDirectories
|
||||
import kotlin.io.path.deleteIfExists
|
||||
import kotlin.io.path.div
|
||||
@ -620,6 +621,7 @@ open class InternalMockNetwork(cordappPackages: List<String> = emptyList(),
|
||||
}
|
||||
messagingNetwork.stop()
|
||||
}
|
||||
SessionFactoryRegistry.INSTANCE.clearRegistrations()
|
||||
}
|
||||
|
||||
/** Block until all scheduled activity, active flows and network activity has ceased. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user