Skip to content

Commit 89d4be2

Browse files
jrenaatsebersole
authored andcommitted
HHH-18437 - Remove deprecations from JdbcSessionContext
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 0a0088d commit 89d4be2

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

hibernate-core/src/main/java/org/hibernate/engine/jdbc/env/internal/JdbcEnvironmentInitiator.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.hibernate.engine.jdbc.internal.JdbcServicesImpl;
3131
import org.hibernate.engine.jdbc.spi.JdbcServices;
3232
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
33-
import org.hibernate.engine.spi.SessionFactoryImplementor;
3433
import org.hibernate.event.internal.EmptyEventManager;
3534
import org.hibernate.event.spi.EventManager;
3635
import org.hibernate.internal.CoreMessageLogger;
@@ -45,7 +44,6 @@
4544
import org.hibernate.resource.jdbc.spi.StatementInspector;
4645
import org.hibernate.resource.transaction.spi.TransactionCoordinator;
4746
import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder;
48-
import org.hibernate.service.ServiceRegistry;
4947
import org.hibernate.service.spi.ServiceRegistryImplementor;
5048
import org.hibernate.stat.spi.StatisticsImplementor;
5149

@@ -608,7 +606,6 @@ private static class TemporaryJdbcSessionOwner implements JdbcSessionOwner, Jdbc
608606

609607
private final JdbcConnectionAccess jdbcConnectionAccess;
610608
private final JdbcServices jdbcServices;
611-
private final ServiceRegistryImplementor serviceRegistry;
612609
private final boolean jtaTrackByThread;
613610
private final boolean preferUserTransaction;
614611
private final boolean connectionProviderDisablesAutoCommit;
@@ -626,7 +623,6 @@ public TemporaryJdbcSessionOwner(
626623
this.jdbcConnectionAccess = jdbcConnectionAccess;
627624
this.jdbcServices = jdbcServices;
628625
this.sqlExceptionHelper = sqlExceptionHelper;
629-
this.serviceRegistry = serviceRegistry;
630626
final ConfigurationService configuration = serviceRegistry.requireService( ConfigurationService.class );
631627
this.jtaTrackByThread = configuration.getSetting( JTA_TRACK_BY_THREAD, BOOLEAN, true );
632628
this.preferUserTransaction = getBoolean( PREFER_USER_TRANSACTION, configuration.getSettings() );
@@ -749,16 +745,6 @@ public JdbcEventHandler getEventHandler() {
749745
return EMPTY_JDBC_EVENT_HANDLER;
750746
}
751747

752-
@Override
753-
public SessionFactoryImplementor getSessionFactory() {
754-
return null;
755-
}
756-
757-
@Override
758-
public ServiceRegistry getServiceRegistry() {
759-
return serviceRegistry;
760-
}
761-
762748
@Override
763749
public JdbcServices getJdbcServices() {
764750
return jdbcServices;

hibernate-core/src/main/java/org/hibernate/internal/JdbcSessionContextImpl.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
1616
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
1717
import org.hibernate.resource.jdbc.spi.StatementInspector;
18-
import org.hibernate.service.ServiceRegistry;
1918
import org.hibernate.stat.spi.StatisticsImplementor;
2019

2120
/**
@@ -99,16 +98,6 @@ public JdbcEventHandler getEventHandler() {
9998
return jdbcEventHandler;
10099
}
101100

102-
@Override @Deprecated
103-
public SessionFactoryImplementor getSessionFactory() {
104-
return sessionFactory;
105-
}
106-
107-
@Override @Deprecated
108-
public ServiceRegistry getServiceRegistry() {
109-
return sessionFactory.getServiceRegistry();
110-
}
111-
112101
private SessionFactoryOptions settings() {
113102
return sessionFactory.getSessionFactoryOptions();
114103
}

hibernate-core/src/main/java/org/hibernate/resource/jdbc/spi/JdbcSessionContext.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
1010
import org.hibernate.engine.jdbc.spi.JdbcServices;
11-
import org.hibernate.engine.spi.SessionFactoryImplementor;
1211
import org.hibernate.jpa.spi.JpaCompliance;
13-
import org.hibernate.service.ServiceRegistry;
1412
import org.hibernate.stat.spi.StatisticsImplementor;
1513

1614
/**
@@ -59,23 +57,6 @@ public interface JdbcSessionContext {
5957

6058
JdbcEventHandler getEventHandler();
6159

62-
/**
63-
* Retrieve the session factory for this environment.
64-
*
65-
* @deprecated exposing this here seems to kinda defeat the purpose of this SPI
66-
*/
67-
@Deprecated(since = "6.2")
68-
SessionFactoryImplementor getSessionFactory();
69-
70-
/**
71-
* Retrieve the service registry.
72-
*
73-
* @deprecated this is no longer called, and unnecessary, since the needed
74-
* services are now available via {@link #getJdbcServices()}
75-
*/
76-
@Deprecated(since = "6.2")
77-
ServiceRegistry getServiceRegistry();
78-
7960
JdbcServices getJdbcServices();
8061

8162
BatchBuilder getBatchBuilder();

hibernate-core/src/test/java/org/hibernate/orm/test/jdbc/JdbcCoordinatorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public void testConnectionClose()
6161
jdbcConnectionAccess );
6262

6363
ServiceRegistry serviceRegistry = Mockito.mock( ServiceRegistry.class );
64-
when( sessionContext.getServiceRegistry() ).thenReturn( serviceRegistry );
6564
when( sessionContext.getPhysicalConnectionHandlingMode() ).thenReturn(
6665
PhysicalConnectionHandlingMode.IMMEDIATE_ACQUISITION_AND_HOLD );
6766

0 commit comments

Comments
 (0)