Skip to content

Commit

Permalink
Merge pull request #42002 from geoand/#42001
Browse files Browse the repository at this point in the history
Remove erroneous check in AbstractJpaOperations#getSession
  • Loading branch information
geoand authored Jul 19, 2024
2 parents 4a385dc + 2dd89e1 commit 65b9c8d
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.\" "
Expand Down

0 comments on commit 65b9c8d

Please sign in to comment.