Re: JDBC batching MySQL

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 27 2010 - 12:24:06 UTC

  • Next message: caden whitaker: "Dynamic loading of configuration mapping"

    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



    This archive was generated by hypermail 2.0.0 : Wed Oct 27 2010 - 12:24:43 UTC