Can MySqlBulkLoader be used with a transaction? I don't see a way to explicitly attach a transaction to an instance of the loader. Is there another way?
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
As stated here by member of MySQL documentation team:
Work arround is to import data to dedicated table and then execute
INSERT INTO ... SELECT ...
which will be atomic operation. On huge data sets this is potential problem becasue of long transaction.The MySQL manual indicates that the MySqlBulkLoader is a wrapper of 'LOAD DATA INFILE'. While looking at the 'LOAD DATA INFILE' documentation I noticed this paragraph:
I found no discussion on transactions but the above paragraph would indicate that transactions are not possible.
A workaround would be to import the data into a import table and then use a separate stored procedure to process the data using transactions into the desired table.
So in answ