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

refreshAll doesn't reattach deleted entities #482

Closed
hrach opened this issue Jan 31, 2021 · 0 comments
Closed

refreshAll doesn't reattach deleted entities #482

hrach opened this issue Jan 31, 2021 · 0 comments
Labels

Comments

@hrach
Copy link
Member

hrach commented Jan 31, 2021

Entity may get deleted. But, the transaction may fail and refreshAll() is used to recover the rollbacked db state. Therefore refreshAll() has to be able reattach such deleted entity.

try {
	$this->orm->removeAndFlush($location);
} catch (ForeignKeyConstraintViolationException $e) {
	$this->orm->locations->getMapper()->rollback();
	$this->orm->refreshAll();
}

Originally posted by @Patrik-K2D in #480

@hrach hrach added the bug label Jan 31, 2021
@hrach hrach closed this as completed in 11ed0b7 Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant