Bug with BatchUpdateException for Batch Import - gives incorrect # of rows inserted
See issue 9021 on how to get the table structure and data file
I can reproduce the problem using batch import (not BCP import) and choose "first row contains column names" option.
Let's look at the first 10 lines of your data file.
When the "first row contains column names" option is checked, the first row is not considered as data. It looks like 3 records get inserted, but BatchUpdateException.getUpdateCounts() returns 2 elements only.
f,g,h,i <-- column names, not imported
j,k,l,m <-- success
a,b,c,d <-- success
j,k,l,m <-- error, duplicate
a,b,c,d <-- error, duplicate
f,g,h,i <-- success (select query shows that this record gets inserted)
j,k,l,m
a,b,c,d
f,g,h,i
j,k,l,m
When the "first row contains column names" option is not checked, the first row is imported. In this case, the first 3 records get inserted and BatchUpdateException.getUpdateCounts() returns 3 elements correctly.
f,g,h,i <-- success
j,k,l,m <-- success
a,b,c,d <-- success
j,k,l,m <-- error, duplicate
a,b,c,d <-- error, duplicate
f,g,h,i <-- error, duplicate
j,k,l,m
a,b,c,d
f,g,h,i
j,k,l,m
There is a bug with BatchUpdateException -- Sybase bug, not ours.
Issue #9697 |
New |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
relates to #9021
Issue #9021Import: batch mode - final row count shown in the status field might be incorrect |