dbTalk Databases Forums  

Strange get next-operation in Pervasive 8.6?

comp.databases.btrieve comp.databases.btrieve


Discuss Strange get next-operation in Pervasive 8.6? in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nmm
 
Posts: n/a

Default Strange get next-operation in Pervasive 8.6? - 09-04-2008 , 09:55 AM






Hi, i have a - may be deep - btrieve-question:

The situation is as follows: (Pervasive 8.6):

we have a plain btrieve-file (btrieve-version 7.x), say product.dat,
with internal indices
AUTOINC
and a second index(let me call'em KARTON) with two segments:
1. a fiels from type LONGINT (the field KARTON)
2. AUTOINC

Pervasive itself does only know the position of the keysegments - real
field-information are due to the application: there are no DDF-files!

The contents of the field KARTON is not unique, i.e. there are several
records containing the same number in this fields (the KARTON-Nr!).

Now I want to read all records with the same KARTON-Nr. K

so I use a while-loop:

start with

Get Greater Than or Equal operation (9= B_GET_GE)

and continue with

Get Next operation (6=B_GET_NEXT)

while the contents of the loaded record is identical with the
the given KOARTON-Nr (or B_GET_NEXT returns Status <>0).


In most cases this will lead to the desired result.

But now we have observed in a productive envrionment, that for unknown
reasons this while-loop reports more(!) records with the same
KARTON-NR then existent in the datafile, i.e. some of the records
appear twice.
It semms, that the B_GET_NEXT operation sometimes returns not the next
but the current record again.

Up to now we observe only one incident of this type.

Fact is, that during the while-loop runs, there where several update
(3) - and insert (2) operations on that file (from other sessions).
The updates definitely does not change the above index much less the
key involved (i.e. key-vales are not changed! this we where able to
verify by analyse a special log-file). The insert-operations of course
affect the index, but the really added records all come by KARTON-Nr=0
(the while - loop runs with KARTON-NR<>0).

We guess, that while insert new key to the index (insert-operation)
the key-pages (sometimes) are reorganised in such a way, that a
database-cursor (from an different session) points now in such a way,
that the following next (6)-operation will report the same record again?

The question is:
-is this possible at all? does the engine do such "reorganisation"?
-is this a known issus in PSQL 8.6 (and is it fixed in 9.x/10.x?)
-if the described (presumed!) reorganisation of key-pages will not
occur, what other reason may be respnsible for that? (all Get Next
operations of the while-loop returned Status 0!).

Any hints, comments, remarks etc. are very wellcome!

Regards
Mircea



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.