Subject Re: [IBO] Invalid Blob ID
Author colinriley666
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
>
> Once you call the transaction's CommitUpdates method, the record is
gone
> from the cache (even though it is still in the dataset buffer).
>
> Blobs aren't actually part of the record structure: they are
stored on
> their own database pages and linked by the blob_id (which is part
of the
> record). You never edit blobs: the previous blob image is totally
> replaced by a new one and it gets a new blob_id when the "update"
is
> posted. The new blob_id won't be known in the buffer until you
call
> Refresh on the dataset. Meanwhile, your user sails on with her
second pass
> at editing this blob and doesn't discover the invalid (old) blob_id
until
> the second-time update tries to post.
>
> If you want the new image of the blob to be available for a
successive edit
> following CommitUpdates, you need to refresh the buffer, so that
the new
> iblob image, along with its new blob_id, will be re-fetched from
the server.
>
> Helen

Helen, thanks for the response. I should have mentioned that I
have
CommitAction := caRefresh
in the TIBOQuery. I experimented a bit more, and removed my call to
TIBOQuery.CommitUpdates which was probably overwriting the new blobid
from the refresh with the old one from the original fetch. Things
appear to be ok now, but I seem to remember that I added
the "CommitUpdates" to fix a previous obscure error which I
unfortunately no longer remember.