提交 1f1c697f 编写于 作者: X xiyelife

fix #2923

上级 8e9b2581
......@@ -273,9 +273,7 @@ public abstract class AbstractShardingPreparedStatementAdapter extends AbstractU
parameters.set(parameterIndex - 1, value);
}
@SneakyThrows
protected final void replaySetParameter(final PreparedStatement preparedStatement, final List<Object> parameters) {
preparedStatement.setQueryTimeout(super.queryTimeout);
setParameterMethodInvocations.clear();
addParameters(parameters);
for (SetParameterMethodInvocation each : setParameterMethodInvocations) {
......@@ -299,6 +297,5 @@ public abstract class AbstractShardingPreparedStatementAdapter extends AbstractU
public final void clearParameters() {
parameters.clear();
setParameterMethodInvocations.clear();
super.queryTimeout = 0;
}
}
......@@ -45,8 +45,6 @@ public abstract class AbstractStatementAdapter extends AbstractUnsupportedOperat
private int fetchSize;
protected int queryTimeout;
private final ForceExecuteTemplate<Statement> forceExecuteTemplate = new ForceExecuteTemplate<>();
@SuppressWarnings("unchecked")
......@@ -232,7 +230,6 @@ public abstract class AbstractStatementAdapter extends AbstractUnsupportedOperat
@Override
public final void setQueryTimeout(final int seconds) throws SQLException {
recordMethodInvocation(targetClass, "setQueryTimeout", new Class[] {int.class}, new Object[] {seconds});
this.queryTimeout = seconds;
forceExecuteTemplate.execute((Collection) getRoutedStatements(), new ForceExecuteCallback<Statement>() {
@Override
......
......@@ -109,6 +109,7 @@ public final class EncryptPreparedStatement extends AbstractShardingPreparedStat
try {
SQLUnit sqlUnit = getSQLUnit(sql);
preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());
replayMethodsInvocation(preparedStatement);
replaySetParameter(preparedStatement, sqlUnit.getParameters());
return preparedStatement.executeUpdate();
} finally {
......@@ -121,6 +122,7 @@ public final class EncryptPreparedStatement extends AbstractShardingPreparedStat
try {
SQLUnit sqlUnit = getSQLUnit(sql);
preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());
replayMethodsInvocation(preparedStatement);
replaySetParameter(preparedStatement, sqlUnit.getParameters());
boolean result = preparedStatement.execute();
this.resultSet = createEncryptResultSet(preparedStatement);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册