mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 08:05:05 +00:00
HHH-17347 Support for JDK which do not support JFR events
This commit is contained in:
parent
afbce7cf8a
commit
9f1f8e6c09
@ -561,6 +561,7 @@ private static class TemporaryJdbcSessionOwner implements JdbcSessionOwner, Jdbc
|
||||
private final JpaCompliance jpaCompliance;
|
||||
private static final EmptyJdbcObserver EMPTY_JDBC_OBSERVER = EmptyJdbcObserver.INSTANCE;
|
||||
TransactionCoordinator transactionCoordinator;
|
||||
private final EmptyEventManager eventManager;
|
||||
|
||||
public TemporaryJdbcSessionOwner(
|
||||
JdbcConnectionAccess jdbcConnectionAccess,
|
||||
@ -590,6 +591,7 @@ public TemporaryJdbcSessionOwner(
|
||||
.getDefaultConnectionHandlingMode();
|
||||
}
|
||||
this.jpaCompliance = new MutableJpaComplianceImpl( Collections.emptyMap(), false );
|
||||
this.eventManager = new EmptyEventManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -639,7 +641,7 @@ public Integer getJdbcBatchSize() {
|
||||
|
||||
@Override
|
||||
public EventManager getEventManager() {
|
||||
return EmptyEventManager.INSTANCE;
|
||||
return eventManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,13 +17,8 @@
|
||||
import org.hibernate.persister.collection.CollectionPersister;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
|
||||
public class EmptyEventManager implements EventManager {
|
||||
public final class EmptyEventManager implements EventManager {
|
||||
|
||||
public static final EmptyEventManager INSTANCE = new EmptyEventManager();
|
||||
|
||||
private EmptyEventManager(){
|
||||
|
||||
}
|
||||
@Override
|
||||
public HibernateEvent beginSessionOpenEvent() {
|
||||
return null;
|
||||
|
@ -275,7 +275,7 @@ public final class FastSessionServices {
|
||||
this.batchBuilder = serviceRegistry.getService( BatchBuilder.class );
|
||||
final Collection<EventManager> eventManagers = classLoaderService.loadJavaServices( EventManager.class );
|
||||
this.eventManager = eventManagers.isEmpty()
|
||||
? EmptyEventManager.INSTANCE
|
||||
? new EmptyEventManager()
|
||||
: eventManagers.iterator().next();
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@ dependencies {
|
||||
|
||||
// JfrUnit requires JDK 17
|
||||
compileTestJava.onlyIf{
|
||||
jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit
|
||||
jdkVersions.test.release.asInt() >= 17
|
||||
}
|
||||
|
||||
test.onlyIf {
|
||||
jdkVersions.test.release.asInt() >= 17 && jdkVersions.explicit
|
||||
jdkVersions.test.release.asInt() >= 17
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user