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

Properly determine tenant resolver in HibernateMultiTenantConnectionProvider #22502

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Dec 23, 2021

When migrating to the new annotation, this was forgotten somehow so it's
still using the old annotation.
Moving to the method supporting both the new annotation and the old one.

I verified we don't have the warning in the tests. I'll discuss with @yrodiere when he's back if it's worth adding a test.

Fixes #21265

@gsmet
Copy link
Member Author

gsmet commented Dec 23, 2021

@gastaldi @geoand if one of you could approve this one, that would be great. I'd like to have in 2.6.1.Final that I will release tomorrow.

resolverInstance = Arc.container().instance(TenantResolver.class, Default.Literal.INSTANCE);
} else {
resolverInstance = Arc.container().instance(TenantResolver.class,
new PersistenceUnitLiteral(persistenceUnitName));
Copy link
Member Author

@gsmet gsmet Dec 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old annotation. The legacySingleExtensionInstanceForPersistenceUnit method I now call, despite its name, supports both the new annotation and the old one if the new one is not found.

@gastaldi gastaldi added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 23, 2021
@gsmet gsmet changed the title Property determine tenant resolver in HibernateMultiTenantConnectionProvider Properly determine tenant resolver in HibernateMultiTenantConnectionProvider Dec 23, 2021
…rovider

When migrating to the new annotation, this was forgotten somehow so it's
still using the old annotation.
Moving to the method supporting both the new annotation and the old one.

Fixes quarkusio#21265
@gsmet gsmet force-pushed the fix-tenant-resolver-resolution branch from 3798e03 to 7aab5f9 Compare December 23, 2021 13:58
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 23, 2021

Failing Jobs - Building 7aab5f9

Status Name Step Failures Logs Raw logs
Native Tests - Data6 Post Set up JDK 11 ⚠️ Check → Logs Raw logs

@gsmet gsmet merged commit 58cf76b into quarkusio:main Dec 23, 2021
@quarkus-bot quarkus-bot bot added this to the 2.7 - main milestone Dec 23, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Dec 23, 2021
@gsmet gsmet modified the milestones: 2.7 - main, 2.6.1.Final Dec 23, 2021
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/persistence OBSOLETE, DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No instance of TenantResolver was found for persistence unit <default>
2 participants