}
}
catch (SQLException e)
{
NucleusLogger.DATASTORE.error(e);
throw new NucleusDataStoreException(localiser.msg("056012", removeAllStmt), e);
}
try
{
// Shift the remaining indices to remove the holes in ordering
boolean batched = storeMgr.allowsBatching();
ExecutionContext ec = sm.getExecutionContext();
ManagedConnection mconn = storeMgr.getConnection(ec);
try
{
for (int i = 0; i < currentListSize; i++)
{
// Find the number of deleted indexes above this index
int shift = 0;
boolean removed = false;
for (int j = 0; j < indices.length; j++)
{
if (indices[j] == i)
{
removed = true;
break;
}
if (indices[j] < i)
{
shift++;
}
}
if (!removed && shift > 0)
{
internalShift(sm, mconn, batched, i, -1 * shift, (i == currentListSize - 1), ecs);
}
}
}
finally
{
mconn.release();
}
}
catch (MappedDatastoreException e)
{
NucleusLogger.DATASTORE.error(e);
throw new NucleusDataStoreException(localiser.msg("056012", removeAllStmt), e);
}
boolean dependent = ecs.getOwnerMemberMetaData().getCollection().isDependentElement();
if (ecs.getOwnerMemberMetaData().isCascadeRemoveOrphans())
{