Subject RE: [firebird-support] editing a header/detail document.
Author Sasha Matijasic
>
> My original question probably should have been "how bad is to perform a
> bulk
> delete (usualy less than 20 and rarelly more than 300) and then insert
> them
> againg with the (posible) changes". If this is a bad practice I can
> check what
> records changed and update them and delete/insert the deleted/new
> records. This
> only happens when the user opens an already saved document modifies it
> and saves
> it again. Not very often, really.
>

Hi, I still don't quite understand the reasons you are doing it this way, but if you say you are happy with it than it's ok. There are performance penalties because garbage collection must do its work, but if you say it's rare operation you might be okay with it.

I would still prefer not to do it that way. Delete may have side effects, for example you might have another table referencing tables you are deleting from, and in case of on delete set null you must handle it manually...

And again I'm not answering your question directly, because to me the question is of the pattern "how bad is to do something wrong". Well, who cares how bad when you can do it "right". I guess what I'm saying is I would never delete the row only to insert it again, when in reality all that was needed was an update.

Sasha