From cbba75a2c03ec4fbd825f49c8c223caf5d0ce069 Mon Sep 17 00:00:00 2001 From: Gary Verhaegen Date: Mon, 29 Mar 2021 16:56:30 +0200 Subject: [PATCH] oracle: switch to entreprise (#9254) * oracle: switch to entreprise CHANGELOG_BEGIN CHANGELOG_END * --network host changelog_begin changelog_end Co-authored-by: Moritz Kiefer --- ci/build.yml | 10 +++++++--- .../src/it/scala/http/HttpServiceOracleInt.scala | 2 +- .../src/main/scala/testing/oracle/OracleAround.scala | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ci/build.yml b/ci/build.yml index 645b4fcc1e..34e939def7 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -215,18 +215,22 @@ jobs: export ORACLE_PORT=1521 export ORACLE_PWD=hunter2 docker login --username "$DOCKER_LOGIN" --password "$DOCKER_PASSWORD" - IMAGE=digitalasset/oracle-xe-18.4.0-preloaded:20210312-16-7009a64 + IMAGE=digitalasset/oracle:enterprise-19.3.0-preloaded-20210325-22-be14fb7 docker pull $IMAGE # Cleanup stray containers that might still be running from # another build that didn’t get shut down cleanly. docker rm -f oracle || true - docker run -d --rm --name oracle -p $ORACLE_PORT:1521 -e ORACLE_PWD=$ORACLE_PWD $IMAGE + # Oracle does not like if you connect to it via localhost if it’s running in the container. + # Interestingly it works if you use the external IP of the host so the issue is + # not the host it is listening on (it claims for that to be 0.0.0.0). + # --network host is a cheap escape hatch for this. + docker run -d --rm --name oracle --network host -e ORACLE_PWD=$ORACLE_PWD $IMAGE function cleanup() { docker rm -f oracle } trap cleanup EXIT testConnection() { - docker exec oracle bash -c 'sqlplus -L system/hunter2@//localhost:1521/XEPDB1 <<< "select * from dba_users;"; exit $?' >/dev/null + docker exec oracle bash -c 'sqlplus -L system/hunter2@//localhost:1521/ORCLPDB1 <<< "select * from dba_users;"; exit $?' >/dev/null } until testConnection do diff --git a/ledger-service/http-json-oracle/src/it/scala/http/HttpServiceOracleInt.scala b/ledger-service/http-json-oracle/src/it/scala/http/HttpServiceOracleInt.scala index eaa5e24df5..bc6c7c351f 100644 --- a/ledger-service/http-json-oracle/src/it/scala/http/HttpServiceOracleInt.scala +++ b/ledger-service/http-json-oracle/src/it/scala/http/HttpServiceOracleInt.scala @@ -16,7 +16,7 @@ trait HttpServiceOracleInt extends AbstractHttpServiceIntegrationTestFuns with O protected[this] lazy val jdbcConfig_ = JdbcConfig( driver = "oracle.jdbc.OracleDriver", - url = s"jdbc:oracle:thin:@//localhost:$oraclePort/XEPDB1", + url = s"jdbc:oracle:thin:@localhost:$oraclePort/ORCLPDB1", user = oracleUser, password = oraclePwd, createSchema = true, diff --git a/libs-scala/oracle-testing/src/main/scala/testing/oracle/OracleAround.scala b/libs-scala/oracle-testing/src/main/scala/testing/oracle/OracleAround.scala index 687b8b09a7..b5c32faa95 100644 --- a/libs-scala/oracle-testing/src/main/scala/testing/oracle/OracleAround.scala +++ b/libs-scala/oracle-testing/src/main/scala/testing/oracle/OracleAround.scala @@ -37,7 +37,7 @@ trait OracleAround { Using.Manager { use => val con = use( DriverManager.getConnection( - s"jdbc:oracle:thin:@localhost:$port/XEPDB1", + s"jdbc:oracle:thin:@localhost:$port/ORCLPDB1", systemUser, systemPwd, ) @@ -54,7 +54,7 @@ trait OracleAround { Using.Manager { use => val con = use( DriverManager.getConnection( - s"jdbc:oracle:thin:@localhost:$port/XEPDB1", + s"jdbc:oracle:thin:@localhost:$port/ORCLPDB1", systemUser, systemPwd, )