Subject | BLOB NOT FOUND error |
---|---|
Author | Stephen Boyd |
Post date | 2008-10-27T20:30:48Z |
I am using IBO 4.5 with Delphi 5 and Firebird 1.5.5.
I am using a TIB_Query with a TDBGrid to display a result set that
contains blobs. In the OnDrawGridCell event handler I retrieve the
value of these blobs from the query and force them to be drawn in the
cell. In order to avoid having the transaction tied to the query open
for long periods of time I have configured the transaction's
TimeoutProps as follows:
AllowCheckOAT := 10
Attempt := 5
AttemptMaxRows := 1000
AttemptRetry := 1
AttempTicks := 250
ForceClosed := 0
The query has the following set:
CommitAction := caFetchAll;
FetchWholeRows := True;
I am getting sporadic 'BLOB NOT FOUND' errors when someone else
updates a record that is part of the grid's result set, but not yet
visible on the grid. When the user scrolls down to make the updated
record visible, I get the BLOB error.
I think that I know what is causing this. I assume that when the
transaction is committed and the result set is fetched as a result of
the OAT check, the BLOBs' handles are being fetched, but not the
BLOBs' values. Thus, when the cached result set is scrolled and my
program attempts to get the value of the blob, IBO attempts to fetch
the blob from the database but can't do it because the blob handle has
changed because of the update by another user.
Knowing all this (or at least thinking I do) is nice, but how do I get
around this problem? Without turning off the OAT checking or
refreshing the query every time the user wants to scroll it. Is the
some way to force the actual contents of the BLOB to be cached rather
than just its handle? The blobs in question are quite small (< 5K).
Oh! The result set is being fetched from a stored procedure so
turning off FetchWholeRows is not the answer.
Any suggestions are welcome.
I am using a TIB_Query with a TDBGrid to display a result set that
contains blobs. In the OnDrawGridCell event handler I retrieve the
value of these blobs from the query and force them to be drawn in the
cell. In order to avoid having the transaction tied to the query open
for long periods of time I have configured the transaction's
TimeoutProps as follows:
AllowCheckOAT := 10
Attempt := 5
AttemptMaxRows := 1000
AttemptRetry := 1
AttempTicks := 250
ForceClosed := 0
The query has the following set:
CommitAction := caFetchAll;
FetchWholeRows := True;
I am getting sporadic 'BLOB NOT FOUND' errors when someone else
updates a record that is part of the grid's result set, but not yet
visible on the grid. When the user scrolls down to make the updated
record visible, I get the BLOB error.
I think that I know what is causing this. I assume that when the
transaction is committed and the result set is fetched as a result of
the OAT check, the BLOBs' handles are being fetched, but not the
BLOBs' values. Thus, when the cached result set is scrolled and my
program attempts to get the value of the blob, IBO attempts to fetch
the blob from the database but can't do it because the blob handle has
changed because of the update by another user.
Knowing all this (or at least thinking I do) is nice, but how do I get
around this problem? Without turning off the OAT checking or
refreshing the query every time the user wants to scroll it. Is the
some way to force the actual contents of the BLOB to be cached rather
than just its handle? The blobs in question are quite small (< 5K).
Oh! The result set is being fetched from a stored procedure so
turning off FetchWholeRows is not the answer.
Any suggestions are welcome.