From: Leyne, S. <Se...@br...> - 2007-01-30 20:31:15
|
Ivan, > >> >> Statement failed, SQLCODE =3D -901 > >> >> cannot update erased record > ... > > - The message is completely valid, and expected when using READ > > COMMITTED. >=20 > Can you describe, in your words, what message this error > tries to tell to the user ? >=20 >=20 > I will try first: > Situation 1) If I do DELETE FROM TAB WHERE ID=3D1; > and the record is there, it is successfully deleted. >=20 > Situation 2) If I do DELETE FROM TAB WHERE ID=3D1; > but somebody else did the same (and committed) > just fraction of second before me, my command > still returns o.k. (with rows affected=3D0) >=20 > Situation 3) If I do DELETE FROM TAB WHERE ID=3D1; > and somebody else did the same "at the same time > but a bit sooner than me", then I can get error "erased record" > with the meaning > "Oh dear, you NEARLY deleted that record, but somebody > else was faster. Sorry." >=20 > Do you have some example of situation when it is important > to distinguish case 2 and 3 ? First, the examples you provide is not the issue you originally reported, which was that User #2 tried to *update* a record which had been deleted by User #1. The answer depends on whether the developer/user expects that someone else can delete the record. Without the error, a developer/user could easily blame the database for "loosing" the changes that they applied. The fact that you are using READ COMMITTED is the reason why an action performed by another user should be reported to you. > It was my original intention to just handle that error, > but as you can read in my other post, this error does not have > its own ErrorCode, so it can't be easily/reliably distinguished > from other errors. That would certainly makes life a little difficult. Sean |