Bulk insert is meant for copying data, so it's not a general-purpose solution such as JDBC batching. If you want to optimize insert statements, I think you should use JDBC batch inserts. In this case, the pooled optimizer performs very well if backed by a database sequence. You also need to make sure you order inserts, in case you are using cascading and also make sure that versioning doesn't prevent you from using JDBC batch updates. If you are interested in this topic, check out this batching chapter from the High-Performance Java Persistence book. You'll find some interesting benchmarks there too. |