Polishing

This commit is contained in:
Juergen Hoeller
2018-07-04 15:07:17 +02:00
parent 094c9b8bd2
commit 5dc8b5de6d
7 changed files with 17 additions and 15 deletions

View File

@@ -203,7 +203,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
* @see org.springframework.jdbc.core.JdbcTemplate
*/
public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource).

View File

@@ -255,7 +255,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
* @see org.springframework.jdbc.core.JdbcTemplate
*/
public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) {
if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource).