Skip to content

Commit

Permalink
Remove erroneous check in AbstractJpaOperations#getSession
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Jul 19, 2024
1 parent 8246009 commit 2dd89e1
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 2dd89e1

Please sign in to comment.