--UPDATE--After troubleshooting, we discovered the issue was related to our Shareplow installation. Appreciate everyone's efforts!
Following the advice found on Performance of MySQL Insert statements in Java: Batch mode prepared statements vs single insert with multiple values, I attempted to utilize bulk insert prepared statements. However, only the initial row is successfully being inserted.
Included below is a snippet of my code:
var sql2 = 'INSERT INTO ' + memtable2 + ' (' + locNameCol2 + ', ' + sectTypeCol + ', ' + sectPathCol + ') VALUES ';
var cntr = 0;
for (var key in polyObj) {
if(cntr){
sql2 += ',';
}
sql2 += '(?,?,?)';
cntr = 1;
}
var s2 = con2.prepareStatement(sql2);
cntr = 0;
for (var key in polyObj) {
indxOffset = 3*cntr;
s2.setString(indxOffset+1 , fieldNameVal);
s2.setString(indxOffset+2 , 'Poly');
s2.setString(indxOffset+3 , polyObj[key]);
rval += 'index offset ' + indxOffset;
cntr++;
}
s2.execute();
The first row is inserted without any issues, but subsequent rows fail to be inserted. Upon examining the constructed sql2 string, it appears to be generated correctly for the number of properties in polyObj. For instance, if polyObj contains 3 properties, the SQL statement would resemble:
Insert into table (col1, col2, col3) values (?,?,?),(?,?,?),(?,?,?)
Could there possibly be a database setting preventing multiple row inserts? Or could I be overlooking something? Any insights would be greatly appreciated as I am at a loss.
Thank you in advance.