1
1
/*
2
- * Copyright 2002-2021 the original author or authors.
2
+ * Copyright 2002-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -148,7 +148,7 @@ public Object beginTransaction(EntityManager entityManager, TransactionDefinitio
148
148
if (isolationLevelNeeded || definition .isReadOnly ()) {
149
149
if (this .prepareConnection && ConnectionReleaseMode .ON_CLOSE .equals (
150
150
session .getJdbcCoordinator ().getLogicalConnection ().getConnectionHandlingMode ().getReleaseMode ())) {
151
- preparedCon = session .connection ();
151
+ preparedCon = session .getJdbcCoordinator (). getLogicalConnection (). getPhysicalConnection ();
152
152
previousIsolationLevel = DataSourceUtils .prepareConnectionForTransaction (preparedCon , definition );
153
153
}
154
154
else if (isolationLevelNeeded ) {
@@ -356,9 +356,9 @@ public void resetSessionState() {
356
356
}
357
357
if (this .needsConnectionReset &&
358
358
this .session .getJdbcCoordinator ().getLogicalConnection ().isPhysicallyConnected ()) {
359
- Connection conToReset = this .session .connection ();
359
+ Connection con = this .session .getJdbcCoordinator (). getLogicalConnection (). getPhysicalConnection ();
360
360
DataSourceUtils .resetConnectionAfterTransaction (
361
- conToReset , this .previousIsolationLevel , this .readOnly );
361
+ con , this .previousIsolationLevel , this .readOnly );
362
362
}
363
363
}
364
364
}
@@ -374,7 +374,7 @@ public HibernateConnectionHandle(SessionImplementor session) {
374
374
375
375
@ Override
376
376
public Connection getConnection () {
377
- return this .session .connection ();
377
+ return this .session .getJdbcCoordinator (). getLogicalConnection (). getPhysicalConnection ();
378
378
}
379
379
}
380
380
0 commit comments