Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverted JoinListStore#internalAdd to non bulk shift insertion strategy to avoid issue #464 #465

Open
wants to merge 1 commit into
base: 5.2
Choose a base branch
from
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