}
private CallableStatement bindStmt(PersistRequestCallableSql request, boolean batchThisRequest) throws SQLException {
SpiCallableSql callableSql = request.getCallableSql();
SpiTransaction t = request.getTransaction();
String sql = callableSql.getSql();
BindParams bindParams = callableSql.getBindParams();
// process named parameters if required
sql = BindParamsParser.parse(bindParams, sql);
boolean logSql = request.isLogSql();
CallableStatement cstmt;
if (batchThisRequest){
cstmt = pstmtFactory.getCstmt(t, logSql, sql, request);
} else {
if (logSql){
t.logSql(sql);
}
cstmt = pstmtFactory.getCstmt(t, sql);
}
if (callableSql.getTimeout() > 0){
cstmt.setQueryTimeout(callableSql.getTimeout());
}
String bindLog = null;
if (!bindParams.isEmpty()){
bindLog = binder.bind(bindParams, new DataBind(cstmt));