net.corda.node.internal / Node / initialiseDatabasePersistence

# initialiseDatabasePersistence

`protected fun initialiseDatabasePersistence(insideTransaction: () -> Unit): Unit`
Overrides AbstractNode.initialiseDatabasePersistence

If the node is persisting to an embedded H2 database, then expose this via TCP with a JDBC URL of the form: jdbc:h2:tcp://:/node with username and password as per the DataSource connection details. The key element to enabling this support is to ensure that you specify a JDBC connection URL of the form jdbc:h2:file: in the node config and that you include the H2 option AUTO_SERVER_PORT set to the port you desire to use (0 will give a dynamically allocated port number) but exclude the H2 option AUTO_SERVER=TRUE. This is not using the H2 "automatic mixed mode" directly but leans on many of the underpinnings. For more details on H2 URLs and configuration see: http://www.h2database.com/html/features.html#database_url