Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Fixing db pool connection deadlock caused by nested SqlService #19
Browse files Browse the repository at this point in the history
  • Loading branch information
yq12 committed Apr 17, 2020
1 parent a54b01c commit 568ada7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ public List dbRead(Connection callerConn, String sql, Object[] fields, SqlReader
conn = callerConn;
} else {
conn = borrowConnection();
threadLocalManager().set(TRANSACTION_CONNECTION, conn);
}
if (m_showSql) {
connectionTime = System.currentTimeMillis() - start;
Expand Down Expand Up @@ -616,6 +617,7 @@ public List dbRead(Connection callerConn, String sql, Object[] fields, SqlReader
LOG.warn("Sql.dbRead: sql: " + sql + debugFields(fields), e);
}
}
threadLocalManager().set(TRANSACTION_CONNECTION, null);
returnConnection(conn);
}
}
Expand Down

0 comments on commit 568ada7

Please sign in to comment.