From 237a3a342e1af43739de2f7d24b4cc9c06c4a7c5 Mon Sep 17 00:00:00 2001 From: zillionme Date: Wed, 11 Oct 2023 14:18:31 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=ED=8A=B8=EB=9E=9C=EC=9E=AD?= =?UTF-8?q?=EC=85=98=20=EB=A7=A4=EB=8B=88=EC=A0=80=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=98=EB=8A=94=20SQL=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=EC=B2=98=EB=A6=AC=EB=B0=A9=EB=B2=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/support/TransactionManager.java | 6 +++--- .../transaction/support/exception/TransactionException.java | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 jdbc/src/main/java/org/springframework/transaction/support/exception/TransactionException.java diff --git a/jdbc/src/main/java/org/springframework/transaction/support/TransactionManager.java b/jdbc/src/main/java/org/springframework/transaction/support/TransactionManager.java index 41bedc1e4b..6030a5284e 100644 --- a/jdbc/src/main/java/org/springframework/transaction/support/TransactionManager.java +++ b/jdbc/src/main/java/org/springframework/transaction/support/TransactionManager.java @@ -1,7 +1,7 @@ package org.springframework.transaction.support; -import org.springframework.dao.DataAccessException; import org.springframework.jdbc.datasource.DataSourceUtils; +import org.springframework.transaction.support.exception.TransactionException; import javax.sql.DataSource; import java.sql.Connection; @@ -33,7 +33,7 @@ public T executeWithResult(final Supplier logicExecutor) { return result; } catch (Exception e) { rollback(conn); - throw new DataAccessException(e); + throw new TransactionException(e); } finally { setTransactionInactive(conn); DataSourceUtils.releaseConnection(conn, dataSource); @@ -56,7 +56,7 @@ private void rollback(final Connection conn) { try { conn.rollback(); } catch (SQLException e) { - throw new DataAccessException(e); + throw new TransactionException(e); } } } diff --git a/jdbc/src/main/java/org/springframework/transaction/support/exception/TransactionException.java b/jdbc/src/main/java/org/springframework/transaction/support/exception/TransactionException.java new file mode 100644 index 0000000000..231c4768ce --- /dev/null +++ b/jdbc/src/main/java/org/springframework/transaction/support/exception/TransactionException.java @@ -0,0 +1,6 @@ +package org.springframework.transaction.support.exception; + +public class TransactionException extends RuntimeException { + public TransactionException(final Exception e) { + } +}