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

Decide how ElggBatch can handle callbacks that delete rows (Trac #4288) #4288

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 5 comments
Closed
Labels
Milestone

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/4288 on 42028116-10-15 by brettp, assigned to brettp.

Elgg version: 1.8

ElggBatch uses offsets and limits to grab subsets of rows and then passes those rows though a callback. If the callback deletes rows, ElggBatch will never touch some of the rows because of the changing offset.

We need to come up with a way to allow the callback to delete entities.

Part of this fix is to restore elgg_delete_annotations() and elgg_delete_metadata() to using ElggBatch.

See also #4269.

@elgg-gitbot
Copy link
Author

brettp wrote on 42039262-10-18

The best idea I have for this right now is to pass a flag to ElggBatch to ignore offset when grabbing chunks of data from the db. Other thoughts?

@elgg-gitbot
Copy link
Author

brettp wrote on 42067453-12-03

Current plan is to add an optional argument to the ElggBatch constructor to always force the offset to 0. Does anyone have other ideas?

@elgg-gitbot
Copy link
Author

cash wrote on 42067483-01-17

callback doesn't know about ElggBatch. The code that uses ElggBatch doesn't have a chance to rewind between queries. It has to be done by setting a parameter in ElggBatch - either in the constructor or in a setter.

@elgg-gitbot
Copy link
Author

trac user Brett Profitt wrote on 42069425-05-17

Fixes #4288. Added setIncrementOffset() to ElggBatch.
Changeset: e2af7b7

@elgg-gitbot
Copy link
Author

trac user Brett Profitt wrote on 42088991-01-29

Fixes #4288. Added setIncrementOffset() to ElggBatch.
Changeset: e2af7b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant