MySqlBulkLoader可以与事务一起使用吗? [英] Can MySqlBulkLoader be used with a transaction?

查看:136
本文介绍了MySqlBulkLoader可以与事务一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySqlBulkLoader可以与事务一起使用吗?我看不到一种将事务显式附加到加载程序实例的方法.还有另一种方法吗?

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?

推荐答案

此处所述MySQL文档小组成员:

As stated here by member of MySQL documentation team:

It's not atomic.  The records loaded prior to the error will be in the
table.

工作范围是将数据导入专用表,然后执行INSERT INTO ... SELECT ...,这将是原子操作.在海量数据集上,这是潜在的问题,因为长期交易.

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.

这篇关于MySqlBulkLoader可以与事务一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆