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

Remove erroneous check in AbstractJpaOperations#getSession #42002

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove erroneous check in AbstractJpaOperations#getSession
Fixes: #42001
geoand committed Jul 19, 2024
commit 2dd89e1fade42808d6752571133b0dbf7aa5196a
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@
import org.hibernate.query.SelectionQuery;

import io.agroal.api.AgroalDataSource;
import io.quarkus.agroal.DataSource;
import io.quarkus.arc.Arc;
import io.quarkus.arc.ArcContainer;
import io.quarkus.arc.InstanceHandle;
@@ -84,12 +83,6 @@ public Session getSession(String persistentUnitName) {
if (sessionHandle.isAvailable()) {
return sessionHandle.get();
}
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.");
}
throw new IllegalStateException(
"No entities were attached to persistence unit '" + persistentUnitName
+ "'. Did you forget to annotate your Panache Entity classes with '@Entity' or improperly configure the 'quarkus.hibernate-orm.\" "