From: Dmitry Y. <fir...@ya...> - 2007-01-30 21:33:14
|
Ivan Prenosil wrote: > > I think that it can occur in the following situation: > > Updating (or deleting) a record consists of two stages > - old record version is read into buffer > - new record version is created/stored > > If it is done in READ COMMITED transaction, > and some other transaction deletes that record and > manages to commit it between those two stages, > then "cannot update erased record" is raised. Correct. > * Somehow, it seems to me that this error is more artifact of the way > the command is internally processed than real error. I'd say it's an artifact of the read-committed implementation. > * It can be raised in the situation one would not expect it - normally > the DELETE/UPDATE command either succeeds because > it deletes/updates required record(s), or it succeeds because there is nothing > to delete/update (e.g. delete from tab where 1=2;) > But in described situation the DELETE can complain that record > was already deleted - looks strange. I kinda agree. But I think that all related issues should be solved as a whole. For example, if the concurrent transaction has modified the record, we need to re-fetch it and re-evaluate booleans. In other words, read-committed transactions should (almost?) never experience an update conflict. But it's not very easy to do. > * Could this error by avoided at all ? If the record was deleted, > it means there is nothing to delete/update, so from users point of view > the error has no sense. > The only problem I see is with Before triggers that were already fired, > can't they be just silently undone ? I fail to see how the trigger actions could be undone for a single record, sorry. Dmitry |