public int doUpdate(MappedStatement ms, Object parameterObject) throws SQLException {
        final Configuration configuration = ms.getConfiguration();
        final StatementHandler handler = configuration.newStatementHandler(this, ms, parameterObject, RowBounds.DEFAULT, null, null);
        final BoundSql boundSql = handler.getBoundSql();
        PreparedStatementKey key = new PreparedStatementKey(boundSql.getSql(), ms);
        StatementData statementData = statementsData.get(key);
        if (retainExecuteOrder && statementData != null && !key.equals(lastKey)) {
            statementData = null;
            executeUpTo(key, true);
        }
        if (statementData == null) {
            statementData = unusedStatementData.remove(key);
            if (statementData == null) {
                Connection connection = getConnection(ms.getStatementLog());
                Statement stmt = handler.prepare(connection);
                statementData = new StatementData(stmt);
            }
            statementsData.put(key, statementData);
        }
        lastKey = key;
        statementData.addParameterObject(parameterObject);
        handler.parameterize(statementData.getStatement());
        handler.batch(statementData.getStatement());
        return BATCH_UPDATE_RETURN_VALUE;
    }