From f5d1940ade2efc1f46959deb323fe53de9c85077 Mon Sep 17 00:00:00 2001 From: noear Date: Fri, 3 May 2024 19:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20ConnectionFactory=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=EF=BC=8C=E4=B8=8E=20solon=20=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E5=AF=B9=E6=8E=A5=E8=87=AA=E7=84=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../solon/integration/SolonConnectionFactory.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/trunk/sqltoy-orm-solon-plugin/src/main/java/org/sagacity/sqltoy/solon/integration/SolonConnectionFactory.java b/trunk/sqltoy-orm-solon-plugin/src/main/java/org/sagacity/sqltoy/solon/integration/SolonConnectionFactory.java index 09fa36021..ee4db6463 100644 --- a/trunk/sqltoy-orm-solon-plugin/src/main/java/org/sagacity/sqltoy/solon/integration/SolonConnectionFactory.java +++ b/trunk/sqltoy-orm-solon-plugin/src/main/java/org/sagacity/sqltoy/solon/integration/SolonConnectionFactory.java @@ -12,7 +12,7 @@ public class SolonConnectionFactory implements ConnectionFactory { @Override public Connection getConnection(DataSource dataSource) { try { - return TranUtils.getConnection(dataSource); + return TranUtils.getConnectionProxy(dataSource); } catch (SQLException e) { throw new RuntimeException(e); } @@ -20,14 +20,12 @@ public class SolonConnectionFactory implements ConnectionFactory { @Override public void releaseConnection(Connection connection, DataSource dataSource) { - if (!TranUtils.inTrans()) { - try { - if (connection != null) { - connection.close(); - } - } catch (SQLException e) { - e.printStackTrace(); + try { + if (connection != null) { + connection.close(); } + } catch (SQLException e) { + e.printStackTrace(); } } } -- Gitee