Hot answers tagged auto-commit
According to the documentation, AUTOCOMMIT should be turned off in InnoDB. When importing data into InnoDB, turn off autocommit mode, because it performs a log flush to disk for every insert. When doing bulk inserts into tables with auto-increment columns, set innodb_autoinc_lock_mode to 2 instead of the default value 1
From the Connection.setAutoCommit docs: NOTE: If this method is called during a transaction and the auto-commit mode is changed, the transaction is committed. If setAutoCommit is called and the auto-commit mode is not changed, the call is a no-op. But I don't think it's very readable/obvious in your code. You should probably simply commit before ...
You have a trade-off you need to be aware of. Granted, it is true that a log flush happens with each INSERT involved with autocommit=1. Nevertheless, are there any consequences of setting autocommit=0 ? Think about the redo logs (ib_logfile0,ib_logfile1) and the undo tablespace (inside ibdata1). Change information must be stored somewhere in case the ...
Only top voted, non community-wiki answers of a minimum length are eligible