Re: Retrying a fetch after an error, without restarting the whole loop?
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Thu, 9 Nov 2006 13:14:19 -0800
On 11/9/06, Bart Lateur <bart.lateur@xxxxxxxxxx> wrote:
On Wed, 8 Nov 2006 23:26:02 -0800, Jonathan Leffler wrote:
> Bart Lateur <bart.lateur@xxxxxxxxxx> asked:
>>And 2), in a fetch loop, is it possible to adjust a property like
>> {ReadLongLen}, and retry the same fetch without restarting the whole
>> loop? Because this error typically happened several minutes into the
>> loop.
>
>Highly unlikely. The data has been fetched - and truncated. There's not
>usually a way to refetch the same row - unless you have a scroll cursor,
and
>DBI doesn't have support for those.
I can see that. Well I'm thinking of the following solution next:
retrieve extra data to identify the row that went wrong and collect
them, keep going on with the rest of the records, and individually fetch
the previously failed ones afterwards.
After a failure, I can go on with the next records, can't I? And
changing ReadLongLen, is that acceptable for the remainder of the loop?
That works - I've used it in (non-Perl) code for aeons (dating back to
1986). The primary demerits are (1) two fetches for each row, and (2)
establishing the unique identifier column or columns for the data.
And yes, I can think of no reason why a driver that honours ReadLongLen
would not adapt to changed values as the loop continues. Since
DBD::Informix doesn't pay attention to ReadLongLen in the first place, it
isn't much use looking at that code - and other driver writers would have to
answer for their code.
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."
- References:
- Retrying a fetch after an error, without restarting the whole loop?
- From: Bart Lateur
- Re: Retrying a fetch after an error, without restarting the whole loop?
- From: Jonathan Leffler
- Re: Retrying a fetch after an error, without restarting the whole loop?
- From: Bart Lateur
- Retrying a fetch after an error, without restarting the whole loop?
- Prev by Date: Re: DBD::ADO and Access IMAGE (OLE Object) fields...
- Next by Date: Re: MySQL server has gone away?
- Previous by thread: Re: Retrying a fetch after an error, without restarting the whole loop?
- Next by thread: RE: Retrying a fetch after an error, without restarting the whole loop?
- Index(es):
Relevant Pages
|