Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -420,7 +420,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
|
||||
conHolder.setTimeoutInSeconds(timeoutToUse);
|
||||
}
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Exposing JPA transaction as JDBC transaction [" + conHandle + "]");
|
||||
logger.debug("Exposing JPA transaction as JDBC [" + conHandle + "]");
|
||||
}
|
||||
TransactionSynchronizationManager.bindResource(getDataSource(), conHolder);
|
||||
txObject.setConnectionHolder(conHolder);
|
||||
@@ -537,9 +537,9 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
|
||||
}
|
||||
catch (RollbackException ex) {
|
||||
if (ex.getCause() instanceof RuntimeException) {
|
||||
DataAccessException dex = getJpaDialect().translateExceptionIfPossible((RuntimeException) ex.getCause());
|
||||
if (dex != null) {
|
||||
throw dex;
|
||||
DataAccessException dae = getJpaDialect().translateExceptionIfPossible((RuntimeException) ex.getCause());
|
||||
if (dae != null) {
|
||||
throw dae;
|
||||
}
|
||||
}
|
||||
throw new TransactionSystemException("Could not commit JPA transaction", ex);
|
||||
@@ -606,9 +606,9 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
|
||||
getJpaDialect().releaseJdbcConnection(conHandle,
|
||||
txObject.getEntityManagerHolder().getEntityManager());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
catch (Throwable ex) {
|
||||
// Just log it, to keep a transaction-related exception.
|
||||
logger.error("Could not close JDBC connection after transaction", ex);
|
||||
logger.error("Failed to release JDBC connection after transaction", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user