cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut BolĨina <>
Subject JDBC batching MySQL
Date Wed, 27 Oct 2010 09:00:33 GMT

in another thred Andrus suggested to have a look at current support for
MySQL batching.

According to:

   - (Changes in MySQL Connector/J
corrected in connectorJ 5.1.8)

the batching is supported.

I added

to conection string and in the modeller I set the
Custom Adapter to org.apache.cayenne.dba.mysql.MySQLAdapter

and in the code I initialized the adapter with
        DataDomain dataChannel = (DataDomain) dataContext.getChannel();
        DataNode dataNode = dataChannel.getNode("MapsNode");
        MySQLAdapter mySQLAdapter = (MySQLAdapter) dataNode.getAdapter();

Then I tried different scenarios: datacontext.commit() on every 100 changed
objects and commit after all (4000) objects were added to a datacontext.

I was running my test with connectorJ 5.1.12 and sadly the batch insert does
not work. I was watching the MySQL server's general query log for definite
confirmation what the database is getting from the driver.

Maybe there is something else to set-up? I really wish this would work, as
performance gains are enormous.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message