Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ protected int[] internalShiftBulk(ObjectProvider op, ManagedConnection conn, boo
}

// Execute the statement
return sqlControl.executeStatementUpdate(ec, conn, shiftStmt, ps, executeNow);
return sqlControl.executeStatementUpdate(ec, conn, shiftBulkStmt, ps, executeNow);
}
finally
{
Expand All @@ -612,7 +612,7 @@ protected int[] internalShiftBulk(ObjectProvider op, ManagedConnection conn, boo
}
catch (SQLException sqle)
{
throw new MappedDatastoreException(shiftStmt, sqle);
throw new MappedDatastoreException(shiftBulkStmt, sqle);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,15 @@ else if (elementOwner != op.getObject() && op.getReferencedPC() == null)
// Shift any existing elements so that we can insert the new element(s) at their position
if (!atEnd && start != currentListSize)
{
internalShiftBulk(op, mconn, true, start-1, shift, true);
// boolean batched = currentListSize - start > 0;
// for (int i = currentListSize - 1; i >= start; i--)
// {
// // Shift the index for this row by "shift"
// internalShift(op, mconn, batched, i, shift, (i == start));
// }
// internalShiftBulk(op, mconn, true, start-1, shift, true);
// Revert to "one at a time" shifting to see if that fixed the bug with bulk shifting raised by me:
// https://github.com/datanucleus/datanucleus-rdbms/issues/464
boolean batched = currentListSize - start > 0;
for (int i = currentListSize - 1; i >= start; i--)
{
// Shift the index for this row by "shift"
internalShift(op, mconn, batched, i, shift, (i == start));
}
}
else
{
Expand Down