【问题标题】:Error While Setting up the PostgreSQL database instead of default H2设置 PostgreSQL 数据库而不是默认 H2 时出错
【发布时间】:2021-06-05 15:13:49
【问题描述】:

我正在尝试设置 postgresql 数据库,而不是默认的 H2 数据库在开发环境中,我正在关注以下资源

https://github.com/corda/samples/tree/database_migration_tutorial/database-migration-tutorial

在启动节点时,出现一些与未知属性相关的错误(runMigration=true, database schema="schema name")

正如我在上面的链接中注意到的,我们需要有一个企业 jar 来设置相同的,所以是否必须让 Corda 企业 jar 在 dev 上切换到 postgresql 数据库?如果没有,请告诉我如何处理?

【问题讨论】:

    标签: postgresql h2 corda


    【解决方案1】:

    不幸的是,您引用的示例有点旧。

    如果要使用 postgres,一般只需要在 node gradle 配置文件中指定即可:

    类似这样的:

    node {
    
        ...
    
        extraConfig = [
            dataSourceProperties: [
                    dataSourceClassName : "org.postgresql.ds.PGSimpleDataSource",
                    'dataSource.url' : "jdbc:postgresql://localhost:5432/nodedb",
                    'dataSource.user' : "postgres",
                    'dataSource.password' : "pa$$w0rd"
            ],
            database: [
                    transactionIsolationLevel : "READ_COMMITTED"
            ]
        ]
    }
    

    您可能还想像在此示例中那样添加 runSchemaMigration=true:https://github.com/corda/cordapp-template-java/blob/release-V4/build.gradle#L103

    一些对您有用的资源:

    【讨论】:

      猜你喜欢
      • 2012-10-21
      • 1970-01-01
      • 1970-01-01
      • 2012-12-21
      • 2021-01-06
      • 2014-07-15
      • 2013-02-16
      • 2021-11-19
      • 2018-07-03
      相关资源
      最近更新 更多