Skip to content

Commit e3fd3fa

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

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
@@ -32,7 +32,6 @@
3232
import org.hibernate.engine.jdbc.internal.JdbcServicesImpl;
3333
import org.hibernate.engine.jdbc.spi.JdbcServices;
3434
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
35-
import org.hibernate.engine.spi.SessionFactoryImplementor;
3635
import org.hibernate.event.internal.EmptyEventManager;
3736
import org.hibernate.event.spi.EventManager;
3837
import org.hibernate.internal.CoreMessageLogger;
@@ -47,7 +46,6 @@
4746
import org.hibernate.resource.jdbc.spi.StatementInspector;
4847
import org.hibernate.resource.transaction.spi.TransactionCoordinator;
4948
import org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder;
50-
import org.hibernate.service.ServiceRegistry;
5149
import org.hibernate.service.spi.ServiceRegistryImplementor;
5250
import org.hibernate.stat.spi.StatisticsImplementor;
5351

@@ -613,7 +611,6 @@ private static class TemporaryJdbcSessionOwner implements JdbcSessionOwner, Jdbc
613611

614612
private final JdbcConnectionAccess jdbcConnectionAccess;
615613
private final JdbcServices jdbcServices;
616-
private final ServiceRegistryImplementor serviceRegistry;
617614
private final boolean jtaTrackByThread;
618615
private final boolean preferUserTransaction;
619616
private final boolean connectionProviderDisablesAutoCommit;
@@ -631,7 +628,6 @@ public TemporaryJdbcSessionOwner(
631628
this.jdbcConnectionAccess = jdbcConnectionAccess;
632629
this.jdbcServices = jdbcServices;
633630
this.sqlExceptionHelper = sqlExceptionHelper;
634-
this.serviceRegistry = serviceRegistry;
635631
final ConfigurationService configuration = serviceRegistry.requireService( ConfigurationService.class );
636632
this.jtaTrackByThread = configuration.getSetting( JTA_TRACK_BY_THREAD, BOOLEAN, true );
637633
this.preferUserTransaction = getBoolean( PREFER_USER_TRANSACTION, configuration.getSettings() );
@@ -754,16 +750,6 @@ public JdbcEventHandler getEventHandler() {
754750
return EMPTY_JDBC_EVENT_HANDLER;
755751
}
756752

757-
@Override
758-
public SessionFactoryImplementor getSessionFactory() {
759-
return null;
760-
}
761-
762-
@Override
763-
public ServiceRegistry getServiceRegistry() {
764-
return serviceRegistry;
765-
}
766-
767753
@Override
768754
public JdbcServices getJdbcServices() {
769755
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)