Nullability refinements and related polishing
See gh-32475
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -631,8 +631,9 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
|
||||
TransactionSynchronizationManager.unbindResource(sessionFactory);
|
||||
}
|
||||
TransactionSynchronizationManager.bindResource(sessionFactory, resourcesHolder.getSessionHolder());
|
||||
if (getDataSource() != null && resourcesHolder.getConnectionHolder() != null) {
|
||||
TransactionSynchronizationManager.bindResource(getDataSource(), resourcesHolder.getConnectionHolder());
|
||||
ConnectionHolder connectionHolder = resourcesHolder.getConnectionHolder();
|
||||
if (connectionHolder != null && getDataSource() != null) {
|
||||
TransactionSynchronizationManager.bindResource(getDataSource(), connectionHolder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -535,8 +535,9 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
|
||||
SuspendedResourcesHolder resourcesHolder = (SuspendedResourcesHolder) suspendedResources;
|
||||
TransactionSynchronizationManager.bindResource(
|
||||
obtainEntityManagerFactory(), resourcesHolder.getEntityManagerHolder());
|
||||
if (getDataSource() != null && resourcesHolder.getConnectionHolder() != null) {
|
||||
TransactionSynchronizationManager.bindResource(getDataSource(), resourcesHolder.getConnectionHolder());
|
||||
ConnectionHolder connectionHolder = resourcesHolder.getConnectionHolder();
|
||||
if (connectionHolder != null && getDataSource() != null) {
|
||||
TransactionSynchronizationManager.bindResource(getDataSource(), connectionHolder);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user