Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panache for Hibernate ORM assumes the datasource has the same name as the persistence unit #42001

Closed
yrodiere opened this issue Jul 19, 2024 · 4 comments · Fixed by #42002
Closed
Labels
area/hibernate-orm Hibernate ORM area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Milestone

Comments

@yrodiere
Copy link
Member

yrodiere commented Jul 19, 2024

Describe the bug

See this code:

if (!arcContainer.instance(AgroalDataSource.class,
new DataSource.DataSourceLiteral(persistentUnitName)).isAvailable()) {
throw new IllegalStateException(
"The named datasource '" + persistentUnitName
+ "' has not been properly configured. See https://quarkus.io/guides/datasource#multiple-datasources for information on how to do that.");
}

new DataSource.DataSourceLiteral(persistentUnitName) <= What is going on here?!

As a reminder, the name of the datasource can be completely different from the name of the persistence unit.

@geoand seems this is yours; is there such a thing as too much Monster Energy? 🤔

From what I can see this was introduced to "Provide actionable information when EntityManager is not available in Hibernate Panache". Not sure why this would involve looking up the datasource...

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

@yrodiere yrodiere added the kind/bug Something isn't working label Jul 19, 2024
@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/panache area/persistence OBSOLETE, DO NOT USE labels Jul 19, 2024
Copy link

quarkus-bot bot commented Jul 19, 2024

/cc @FroMage (panache), @gsmet (hibernate-orm), @loicmathieu (panache)

@geoand
Copy link
Contributor

geoand commented Jul 19, 2024

is there such a thing as too much Monster Energy? 🤔

There is not

@geoand
Copy link
Contributor

geoand commented Jul 19, 2024

I need to have a look because I obviously have no idea recollection of me adding this (thank goodness for git)

@geoand
Copy link
Contributor

geoand commented Jul 19, 2024

I think we can safely just drop that check

@geoand geoand closed this as completed in 2dd89e1 Jul 19, 2024
geoand added a commit that referenced this issue Jul 19, 2024
Remove erroneous check in AbstractJpaOperations#getSession
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Jul 19, 2024
@gsmet gsmet modified the milestones: 3.14 - main, 3.13.0 Jul 22, 2024
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 22, 2024
barreiro pushed a commit to barreiro/quarkus that referenced this issue Jul 25, 2024
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Jul 31, 2024
danielsoro pushed a commit to danielsoro/quarkus that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants