mirror of
https://github.com/corda/corda.git
synced 2024-12-28 00:38:55 +00:00
[ENT-1153]: fix merge
This commit is contained in:
parent
e8d833c2fe
commit
a982bb2ae6
@ -46,7 +46,8 @@ data class DevModeOptions(val disableCheckpointChecker: Boolean = false)
|
||||
data class DatabaseConfig(
|
||||
val initDatabase: Boolean = true,
|
||||
val serverNameTablePrefix: String = "",
|
||||
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ
|
||||
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ,
|
||||
val schema: String? = null
|
||||
)
|
||||
|
||||
enum class TransactionIsolationLevel {
|
||||
|
@ -58,9 +58,9 @@ class HibernateConfiguration(val schemaService: SchemaService, private val datab
|
||||
.setProperty("hibernate.format_sql", "true")
|
||||
.setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString())
|
||||
|
||||
if (databaseProperties.getProperty("schema") != null) {
|
||||
if (databaseConfig.schema != null) {
|
||||
// This property helps 'hibernate.hbm2ddl.auto' to work properly when many schemas have similar table names.
|
||||
config.setProperty("hibernate.default_schema", databaseProperties.getProperty("schema"))
|
||||
config.setProperty("hibernate.default_schema", databaseConfig.schema)
|
||||
}
|
||||
|
||||
schemas.forEach { schema ->
|
||||
|
@ -64,7 +64,7 @@ fun testNodeConfiguration(
|
||||
doReturn(emptyList<User>()).whenever(it).rpcUsers
|
||||
doReturn(null).whenever(it).notary
|
||||
doReturn(makeTestDataSourceProperties(myLegalName.organisation)).whenever(it).dataSourceProperties
|
||||
doReturn(DatabaseConfig(myLegalName.organisation)).whenever(it).database
|
||||
doReturn(DatabaseConfig(serverNameTablePrefix = myLegalName.organisation)).whenever(it).database
|
||||
doReturn("").whenever(it).emailAddress
|
||||
doReturn("").whenever(it).exportJMXto
|
||||
doReturn(true).whenever(it).devMode
|
||||
|
@ -27,6 +27,7 @@ import net.corda.node.internal.StartedNode
|
||||
import net.corda.node.internal.cordapp.CordappLoader
|
||||
import net.corda.node.services.api.SchemaService
|
||||
import net.corda.node.services.config.BFTSMaRtConfiguration
|
||||
import net.corda.node.services.config.DatabaseConfig
|
||||
import net.corda.node.services.config.NodeConfiguration
|
||||
import net.corda.node.services.config.NotaryConfig
|
||||
import net.corda.node.services.keys.E2ETestKeyManagementService
|
||||
@ -40,7 +41,6 @@ import net.corda.node.utilities.CordaPersistence
|
||||
import net.corda.testing.DUMMY_NOTARY
|
||||
import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO
|
||||
import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties
|
||||
import net.corda.testing.node.MockServices.Companion.makeTestDatabaseProperties
|
||||
import net.corda.testing.setGlobalSerialization
|
||||
import net.corda.testing.testNodeConfiguration
|
||||
import org.apache.activemq.artemis.utils.ReusableLatch
|
||||
@ -364,7 +364,7 @@ class MockNetwork(defaultParameters: MockNetworkParameters = MockNetworkParamete
|
||||
baseDirectory = baseDirectory(id).createDirectories(),
|
||||
myLegalName = parameters.legalName ?: CordaX500Name(organisation = "Mock Company $id", locality = "London", country = "GB")).also {
|
||||
doReturn(makeTestDataSourceProperties("node_$id", "net_$networkId")).whenever(it).dataSourceProperties
|
||||
doReturn(makeTestDatabaseProperties("node_$id")).whenever(it).database
|
||||
doReturn(DatabaseConfig()).whenever(it).database
|
||||
parameters.configOverrides(it)
|
||||
}
|
||||
val node = nodeFactory(MockNodeArgs(config, this, id, parameters.entropyRoot))
|
||||
|
Loading…
Reference in New Issue
Block a user