Corda Apps not able to connect to SQL database

Hi Team,

I am trying to use SQL Database from back-end instead of H2 database (which is default). When I put the configuration in the conf file, the connection is successfull but while running the database migration script, some errors pop up and it stops there. Basically, I want to have SQL database as a back-end for one of the nodes.

Errors as below

[INFO ] 2022-08-31T18:11:29,609Z [main] internal.Node. - Machine: DESKTOP-KG45542
[INFO ] 2022-08-31T18:11:29,609Z [main] internal.Node. - Working Directory: K:\Udemy_Corda\youtube\HDFCBank
[INFO ] 2022-08-31T18:11:29,610Z [main] internal.Node. - Starting as node on 150.129.159.65:10008
[INFO ] 2022-08-31T18:11:29,779Z [main] cordapp.JarScanningCordappLoader. - Looking for CorDapps in [K:\Udemy_Corda\youtube\HDFCBank\cordapps]
[INFO ] 2022-08-31T18:11:29,807Z [main] cordapp.JarScanningCordappLoader. - No CorDapp paths provided
[INFO ] 2022-08-31T18:11:30,675Z [main] internal.Node. - MessagingService active change to: false
[INFO ] 2022-08-31T18:11:30,923Z [main] internal.Node. - Flow external operation executor has a max of 8 threads
[INFO ] 2022-08-31T18:11:30,989Z [main] BasicInfo. - Running database schema migration scripts …
[INFO ] 2022-08-31T18:11:31,021Z [main] hikari.HikariDataSource. - HikariPool-1 - Starting…
[INFO ] 2022-08-31T18:11:33,491Z [main] hikari.HikariDataSource. - HikariPool-1 - Start completed.
[INFO ] 2022-08-31T18:11:34,565Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:34,580Z [main] jvm.JdbcExecutor. - SELECT CASE ServerProperty(‘EngineEdition’)
WHEN 1 THEN ‘Personal’
WHEN 2 THEN ‘Standard’
WHEN 3 THEN ‘Enterprise’
WHEN 4 THEN ‘Express’
WHEN 5 THEN ‘Azure’
ELSE ‘Unknown’
END
[INFO ] 2022-08-31T18:11:36,955Z [main] jvm.JdbcExecutor. - SELECT CONVERT([sysname], DATABASEPROPERTYEX(N’ICICIBank_Database’, ‘Collation’))
[INFO ] 2022-08-31T18:11:37,040Z [main] jvm.JdbcExecutor. - SELECT CASE ServerProperty(‘EngineEdition’)
WHEN 1 THEN ‘Personal’
WHEN 2 THEN ‘Standard’
WHEN 3 THEN ‘Enterprise’
WHEN 4 THEN ‘Express’
WHEN 5 THEN ‘Azure’
ELSE ‘Unknown’
END
[INFO ] 2022-08-31T18:11:37,240Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,240Z [main] jvm.JdbcExecutor. - SELECT TOP 1 MD5SUM FROM DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
[INFO ] 2022-08-31T18:11:37,245Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,246Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,247Z [main] jvm.JdbcExecutor. - SELECT COUNT() FROM DATABASECHANGELOG
[INFO ] 2022-08-31T18:11:37,254Z [main] changelog.StandardChangeLogHistoryService. - Reading from DATABASECHANGELOG
[INFO ] 2022-08-31T18:11:37,254Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,255Z [main] jvm.JdbcExecutor. - SELECT * FROM DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
[INFO ] 2022-08-31T18:11:37,289Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,289Z [main] jvm.JdbcExecutor. - SELECT COUNT(
) FROM DATABASECHANGELOGLOCK
[INFO ] 2022-08-31T18:11:37,295Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,296Z [main] jvm.JdbcExecutor. - SELECT COUNT(*) FROM DATABASECHANGELOGLOCK
[INFO ] 2022-08-31T18:11:37,419Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,420Z [main] jvm.JdbcExecutor. - SELECT LOCKED FROM DATABASECHANGELOGLOCK WHERE ID=1
[INFO ] 2022-08-31T18:11:37,423Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,431Z [main] lockservice.StandardLockService. - Successfully acquired change log lock
[INFO ] 2022-08-31T18:11:37,449Z [main] migration.VaultStateMigration. - Migrating vault state data to V4 tables {changeSet=migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda, databaseChangeLog=master.changelog.json}
[INFO ] 2022-08-31T18:11:37,473Z [main] migration.MigrationServicesForResolution. - Couldn’t find network parameters file: K:\Udemy_Corda\youtube\HDFCBank\network-parameters. This is expected if the node is starting for the first time. {changeSet=migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda, databaseChangeLog=master.changelog.json}
[ERROR] 2022-08-31T18:11:37,524Z [main] changelog.ChangeSet. - Change Set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda failed. Error: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL] {changeSet=migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda, databaseChangeLog=master.changelog.json}
[INFO ] 2022-08-31T18:11:37,524Z [main] jvm.JdbcExecutor. - select schema_name()
[INFO ] 2022-08-31T18:11:37,541Z [main] lockservice.StandardLockService. - Successfully released change log lock
[ERROR] 2022-08-31T18:11:37,556Z [main] internal.NodeStartupLogging. - Failed to create the datasource: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda:
Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]. See the logs for further information and the cause. [Error Code: database-failed-startup For further information, please go to R3 Documentation - Home]
net.corda.nodeapi.internal.persistence.CouldNotCreateDataSourceException: Could not create the DataSource: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda:
Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]
at net.corda.node.internal.AbstractNodeKt.startHikariPool(AbstractNode.kt:1356) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNode.runDatabaseMigrationScripts(AbstractNode.kt:479) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.Node.runDatabaseMigrationScripts(Node.kt:579) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.subcommands.RunMigrationScriptsCli$runProgram$2.run(RunMigrationScriptsCli.kt:25) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:230) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartup$initialiseAndRun$5.invoke(NodeStartup.kt:169) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartupLogging$DefaultImpls.attempt(NodeStartup.kt:561) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartup.attempt(NodeStartup.kt:169) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartup.initialiseAndRun(NodeStartup.kt:229) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.NodeStartup.initialiseAndRun$default(NodeStartup.kt:181) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.subcommands.RunMigrationScriptsCli.runProgram(RunMigrationScriptsCli.kt:23) ~[corda-node-4.9.jar:?]
at net.corda.cliutils.CliWrapperBase.call(CordaCliWrapper.kt:153) ~[corda-tools-cliutils-4.9.jar:?]
at net.corda.cliutils.CliWrapperBase.call(CordaCliWrapper.kt:116) ~[corda-tools-cliutils-4.9.jar:?]
at picocli.CommandLine.execute(CommandLine.java:1173) ~[picocli-3.9.6.jar:3.9.6]
at picocli.CommandLine.access$800(CommandLine.java:141) ~[picocli-3.9.6.jar:3.9.6]
at picocli.CommandLine$RunLast.handle(CommandLine.java:1367) ~[picocli-3.9.6.jar:3.9.6]
at picocli.CommandLine$RunLast.handle(CommandLine.java:1335) ~[picocli-3.9.6.jar:3.9.6]
at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1243) ~[picocli-3.9.6.jar:3.9.6]
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1526) ~[picocli-3.9.6.jar:3.9.6]
at net.corda.cliutils.CordaCliWrapperKt.start(CordaCliWrapper.kt:89) ~[corda-tools-cliutils-4.9.jar:?]
at net.corda.node.Corda.main(Corda.kt:13) ~[corda-node-4.9.jar:?]
Caused by: net.corda.nodeapi.internal.persistence.DatabaseMigrationException: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda:
Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]
at net.corda.nodeapi.internal.persistence.SchemaMigration.runMigration(SchemaMigration.kt:69) ~[corda-node-api-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:482) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:201) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNodeKt.startHikariPool(AbstractNode.kt:1342) ~[corda-node-4.9.jar:?]
… 20 more
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda:
Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:637) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:179) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:175) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:168) ~[liquibase-core-3.6.3.jar:?]
at net.corda.nodeapi.internal.persistence.SchemaMigration.runMigration(SchemaMigration.kt:67) ~[corda-node-api-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:482) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:201) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNodeKt.startHikariPool(AbstractNode.kt:1342) ~[corda-node-4.9.jar:?]
… 20 more
Caused by: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2$1.invoke(CordaPersistence.kt:113) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2$1.invoke(CordaPersistence.kt:90) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.withErrorHandler(CordaPersistence.kt:248) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:237) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2.invoke(CordaPersistence.kt:107) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2.invoke(CordaPersistence.kt:90) ~[corda-node-api-4.9.jar:?]
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[kotlin-stdlib-1.2.71.jar:1.2.71-release-64 (1.2.71)]
at net.corda.nodeapi.internal.persistence.CordaPersistence.getHibernateConfig(CordaPersistence.kt) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.getEntityManagerFactory(CordaPersistence.kt:119) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction$sessionDelegate$1.invoke(DatabaseTransaction.kt:37) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction$sessionDelegate$1.invoke(DatabaseTransaction.kt:22) ~[corda-node-api-4.9.jar:?]
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[kotlin-stdlib-1.2.71.jar:1.2.71-release-64 (1.2.71)]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction.getSession(DatabaseTransaction.kt) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransactionKt.currentDBSession(DatabaseTransaction.kt:13) ~[corda-node-api-4.9.jar:?]
at net.corda.node.utilities.AppendOnlyPersistentMapBase.getAllPersisted(AppendOnlyPersistentMap.kt:52) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1$currentHash$1.invoke(MigrationServicesForResolution.kt:104) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1$currentHash$1.invoke(MigrationServicesForResolution.kt:96) ~[corda-node-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.withErrorHandler(CordaPersistence.kt:248) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:237) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1.(MigrationServicesForResolution.kt:103) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution.(MigrationServicesForResolution.kt:96) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.CordaMigration$initialiseNodeServices$1.invoke(CordaMigration.kt:67) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.CordaMigration$initialiseNodeServices$1.invoke(CordaMigration.kt:31) ~[corda-node-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.inTopLevelTransaction(CordaPersistence.kt:277) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:242) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.node.migration.CordaMigration.initialiseNodeServices(CordaMigration.kt:64) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.VaultStateMigration.execute(VaultStateMigration.kt:81) ~[corda-node-4.9.jar:?]
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:183) ~[liquibase-core-3.6.3.jar:?]
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1209) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:179) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:175) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:168) ~[liquibase-core-3.6.3.jar:?]
at net.corda.nodeapi.internal.persistence.SchemaMigration.runMigration(SchemaMigration.kt:67) ~[corda-node-api-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:482) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:201) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNodeKt.startHikariPool(AbstractNode.kt:1342) ~[corda-node-4.9.jar:?]
… 20 more
Caused by: net.corda.nodeapi.internal.persistence.HibernateConfigException: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=ICICIBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]
at net.corda.nodeapi.internal.persistence.HibernateConfiguration$Companion.findSessionFactoryFactory(HibernateConfiguration.kt:46) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.HibernateConfiguration$Companion.access$findSessionFactoryFactory(HibernateConfiguration.kt:29) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.HibernateConfiguration.(HibernateConfiguration.kt:55) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2$1.invoke(CordaPersistence.kt:109) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2$1.invoke(CordaPersistence.kt:90) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.withErrorHandler(CordaPersistence.kt:248) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:237) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2.invoke(CordaPersistence.kt:107) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence$hibernateConfig$2.invoke(CordaPersistence.kt:90) ~[corda-node-api-4.9.jar:?]
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[kotlin-stdlib-1.2.71.jar:1.2.71-release-64 (1.2.71)]
at net.corda.nodeapi.internal.persistence.CordaPersistence.getHibernateConfig(CordaPersistence.kt) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.getEntityManagerFactory(CordaPersistence.kt:119) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction$sessionDelegate$1.invoke(DatabaseTransaction.kt:37) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction$sessionDelegate$1.invoke(DatabaseTransaction.kt:22) ~[corda-node-api-4.9.jar:?]
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) ~[kotlin-stdlib-1.2.71.jar:1.2.71-release-64 (1.2.71)]
at net.corda.nodeapi.internal.persistence.DatabaseTransaction.getSession(DatabaseTransaction.kt) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.DatabaseTransactionKt.currentDBSession(DatabaseTransaction.kt:13) ~[corda-node-api-4.9.jar:?]
at net.corda.node.utilities.AppendOnlyPersistentMapBase.getAllPersisted(AppendOnlyPersistentMap.kt:52) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1$currentHash$1.invoke(MigrationServicesForResolution.kt:104) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1$currentHash$1.invoke(MigrationServicesForResolution.kt:96) ~[corda-node-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.withErrorHandler(CordaPersistence.kt:248) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:237) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution$networkParametersService$1.(MigrationServicesForResolution.kt:103) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.MigrationServicesForResolution.(MigrationServicesForResolution.kt:96) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.CordaMigration$initialiseNodeServices$1.invoke(CordaMigration.kt:67) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.CordaMigration$initialiseNodeServices$1.invoke(CordaMigration.kt:31) ~[corda-node-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.inTopLevelTransaction(CordaPersistence.kt:277) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:242) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:210) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.nodeapi.internal.persistence.CordaPersistence.transaction$default(CordaPersistence.kt:217) ~[corda-node-api-4.9.jar:?]
at net.corda.node.migration.CordaMigration.initialiseNodeServices(CordaMigration.kt:64) ~[corda-node-4.9.jar:?]
at net.corda.node.migration.VaultStateMigration.execute(VaultStateMigration.kt:81) ~[corda-node-4.9.jar:?]
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:183) ~[liquibase-core-3.6.3.jar:?]
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1209) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:600) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.6.3.jar:?]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:179) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:175) ~[liquibase-core-3.6.3.jar:?]
at liquibase.Liquibase.update(Liquibase.java:168) ~[liquibase-core-3.6.3.jar:?]
at net.corda.nodeapi.internal.persistence.SchemaMigration.runMigration(SchemaMigration.kt:67) ~[corda-node-api-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:482) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNode$runDatabaseMigrationScripts$3.invoke(AbstractNode.kt:201) ~[corda-node-4.9.jar:?]
at net.corda.node.internal.AbstractNodeKt.startHikariPool(AbstractNode.kt:1342) ~[corda-node-4.9.jar:?]
… 20 more

Thanks,
Kiran Sagar

@peterli-r3 @ashutosh.meher - Kindly comment on this.

@peterli-r3 Tagging you again as discussed in our Developer connect meeting. Please advise on this.

Did you drop the correct JDBC driver in the driver directory of the corda node?

Hi Ashutosh,

Yes, the JDBC driver jar file was placed in the “drivers” directory of the node.

And the process is able to connect to the database and then it ran the migration script but failed in between some hibernate processes.

Thanks,
Kiran Sagar

Hi @kiransagarit ,

I hope you would have fixed the issue, I am looking for some sample code or reference project to connect the Database. Do you have any references or sample projects to share?

Thanks
ajit

Hi Ajit,

Still no luck and response from R3 Corda support team on this.

@ashutosh.meher and @peterli-r3 - Can you please look into this one ? I think many users are struggling to change database apart from default H2 database.

Thanks,
Kiran Sagar

1 Like

Thanks for your response. Even i posted this in many places still waiting for someone to reply.

Hi, @kiransagarit can you share your node database configuration (database URL, datasource className), please?

@snehadamle Please find the details below that I am mentioning in the node config file along with other mandatory details. The jdbc jar file is also placed at required place. Another point to note, it is able to connect to database and process to some point.

dataSourceProperties = {
dataSourceClassName = “com.microsoft.sqlserver.jdbc.SQLServerDataSource”
dataSource.url = “jdbc:sqlserver://DESKTOP-KG45542\SQLExpress:1433;databaseName=HDFCBank_Database”
dataSource.user = “nodeuser”
dataSource.password = “********”
}}

Thanks. This looks good to me. Can you also put the below section of database {…} from this node.conf which specifies the schema name. Also how have you created the schema in the database? Can you post the script which you used to create the schema in the database?

Attached node configuration details here…

Only database is created , rest it taken care when I run corda network bootstrapper .jar (version 4.9).

@kiransagarit Make sure you use a user with proper permissions before connecting the node to the database. You can use and run the below script on your database before starting the node. Basically, the user which you use to connect to the DB needs to be an admin user.

CREATE USER “party_b” WITH LOGIN PASSWORD ‘my_password’; CREATE SCHEMA “party_b_schema”; GRANT USAGE, CREATE ON SCHEMA “party_b_schema” TO “party_b”; GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON ALL tables IN SCHEMA “party_b_schema” TO “party_b”; ALTER DEFAULT privileges IN SCHEMA “party_b_schema” GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON tables TO “party_b”; GRANT USAGE, SELECT ON ALL sequences IN SCHEMA “party_b_schema” TO “party_b”; ALTER DEFAULT privileges IN SCHEMA “party_b_schema” GRANT USAGE, SELECT ON sequences TO “party_b”; ALTER ROLE “party_b” SET search_path = “party_b_schema”;

Also in your connection URL can you add the schema name so that the node knows on which schema the migration scripts to run on.

Considering above script the node.conf will look like this.

dataSourceProperties {
dataSource {
password=“my_password”
url=“jdbc:postgresql://localhost:5432/postgres?currentSchema=party_b_schema”
user=“party_b”
}
dataSourceClassName=“org.postgresql.ds.PGSimpleDataSource”
}

Please give this a try and let me know if this works for you.

Thanks Sneha for looking into this.

Still no luck. schema name cannot be mentioned in the connection string for SQL Server. I tried to explicity give db owner permission then also same error is coming. Attaching logs for same.

Kindly explain what is this hibernate process does with database. It starts failing from same point.

[ERROR] 2022-11-11T10:16:53,369Z [main] changelog.ChangeSet. - Change Set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda failed. Error: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://DESKTOP-KG45542\sqlexpress:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=HDFCBank_Database;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL] {changeSet=migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda, databaseChangeLog=master.changelog.json}
[INFO ] 2022-11-11T10:16:53,370Z [main] jvm.JdbcExecutor. - select schema_name()


@kiransagarit Ok so its ok if you dont specify the currentSchema in the connection string but
make sure you run the below command in your database before connecting your node to the database.

ALTER ROLE “party_b” SET search_path = “party_b_schema”;

This sets the default schema to party_b_schema. Can you confirm if this works? Have you tried this?

The above setting does work for me. If this still doesn’t work for you I will commit my sample with all these details.

Good Day !!!

Please share the sample.

Note : The sample should be using SQL database in back-end. I think whatever you are posting here is related to postgres database not MS SQL database.

Thanks,
Kiran Sagar

Hi @kiransagarit, I assumed it to be Postgres, as SQL Server was not specified in the question.
I would like to inform you that SQL Server is not supported by Corda OS.
The only option which I can see right now will be to either use Corda Enterprise which supports SQLServer or use PostgreSQL with Corda OS.

Thanks @snehadamle for looking into this and confirmation.

Hi Kiran, does your issue got solved? Are you able to connect the Corda community with Postgres?

Can you please confirm Corda community version with postgres ? i am not able to proceed.
Connection is getting successful but node is failing during start. below is the error

[INFO ] 2022-11-15T19:39:47,515Z [main] visitor.ValidatingVisitor. - Skipping change set migration/node-core.changelog-v21.xml::node_transaction_id_size_non-clustered_pk::R3.Corda due to validation error(s): clustered is not allowed on postgresql {changeSet=migration/node-core.changelog-v21.xml::node_transaction_id_size_non-clustered_pk::R3.Corda, databaseChangeLog=master.changelog.json}
[ERROR] 2022-11-15T19:39:47,594Z [main] internal.NodeStartupLogging. - Incompatible database schema version detected, please run schema migration scripts (node with sub-command run-migration-scripts). Reason: There are 111 outstanding database changes that need to be run.
[INFO ] 2022-11-15T20:21:44,089Z [main] cliutils.CordaCliWrapper. - Application Args: