use of org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform in project hibernate-orm by hibernate.
the class SingleNodeTest method afterSessionFactoryBuilt.
@Override
protected void afterSessionFactoryBuilt(SessionFactoryImplementor sessionFactory) {
super.afterSessionFactoryBuilt(sessionFactory);
JtaPlatform jtaPlatform = sessionFactory().getServiceRegistry().getService(JtaPlatform.class);
if (jtaPlatformClass != null) {
assertNotNull(jtaPlatform);
assertEquals(jtaPlatformClass, jtaPlatform.getClass());
}
}
use of org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform in project hibernate-orm by hibernate.
the class SingleNodeTest method withTxSession.
protected void withTxSession(SessionBuilder sessionBuilder, TxUtil.ThrowingConsumer<Session, Exception> consumer) throws Exception {
JtaPlatform jtaPlatform = useJta ? sessionFactory().getServiceRegistry().getService(JtaPlatform.class) : null;
TxUtil.withTxSession(jtaPlatform, sessionBuilder, consumer);
}
use of org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform in project hibernate-orm by hibernate.
the class JtaPlatformInitiator method initiateService.
@Override
@SuppressWarnings({ "unchecked" })
public JtaPlatform initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
final Object setting = configurationValues.get(AvailableSettings.JTA_PLATFORM);
final JtaPlatform platform = registry.getService(StrategySelector.class).resolveStrategy(JtaPlatform.class, setting);
if (platform == null) {
LOG.debugf("No JtaPlatform was specified, checking resolver");
return registry.getService(JtaPlatformResolver.class).resolveJtaPlatform(configurationValues, registry);
}
return platform;
}
Aggregations