quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.57k stars 2.63k forks source link

Default schema for an additional persistence unit cannot be set during runtime #36838

Open thies-bego opened 10 months ago

thies-bego commented 10 months ago

Describe the bug

When setting a default schema for an additional persistence unit (quarkus.hibernate-orm."persistence-unit-name".database.default-schema) it will be ignored, when not set during build time.

Expected behavior

If a schema is given via the property quarkus.hibernate-orm."persistence-unit-name".database.default-schema in an .env file, the schema should be used by hibernate when accessing the database.

Actual behavior

The default schema is only used, when the property quarkus.hibernate-orm."persistence-unit-name".database.default-schema is present in the application.properties, during build time.

How to Reproduce?

No response

Output of uname -a or ver

Linux import-service-pnet-6bf995bd8-frw49 5.15.0-1049-azure #56-Ubuntu SMP Wed Sep 20 12:34:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10) OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)

Quarkus version or git rev

3.5.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

The database used is an AzureSQL database which has the restriction, that a default schema cannot be set for a connection. But as hibernate should build SQL statements, referencing the default schema, this should not be an issue.

yrodiere commented 1 month ago

Hello,

This seems to have slipped through the cracks.

Are you also using schema multitenancy? If so, see #41754.

If not, this is indeed unexpected. can you please provide a repreoducer?

yrodiere commented 1 week ago

Gentle reminder :)

Are you also using schema multitenancy? If so, see #41754.

If not, this is indeed unexpected. can you please provide a reproducer?