cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: JDBC batching MySQL
Date Wed, 27 Oct 2010 12:24:06 GMT

On Oct 27, 2010, at 3:18 PM, Borut BolĨina wrote:

> 
> That is "bind", and not "batch bind" as you just explained.

Ok, so somehow Cayenne didn't switch to batch-bind mode. Looking at the code in BatchAction.java,
batch mode can also be suppressed for AUTO INCREMENT PK, as other drivers (I don't have data
for MySQL) wouldn't pass autogenerated PK back to Cayenne in batch mode:

    public void performAction(Connection connection, OperationObserver observer)
            throws SQLException, Exception {

        BatchQueryBuilder queryBuilder = createBuilder();
        boolean generatesKeys = hasGeneratedKeys();

        if (batch && !generatesKeys) {
            runAsBatch(connection, queryBuilder, observer);
        }
        else {
            runAsIndividualQueries(connection, queryBuilder, observer, generatesKeys);
        }
    }

I guess we need a Jira to research that (and enable batch mode on MySQL by default, as we've
confirmed that it should work on the latest drivers).

Andrus
Mime
View raw message