Hi
I've got a table where I'm frequently overwriting ranges of records. To keep things simple, I've been deleting any existing range:
if is_existing_records = .t. then
tbl.delete_range( "prod_id="+:Product:Prod_id.value )
end if
Then I loop over the new or updated values and enter them using tbl.enter_begin(). These values have the same keys as any deleted values.
The problem comes when I run onestep_backup() with the "Compact Database" option enabled:
code = "onestep_backup();"
A5RunXbasicAfterClosingWindows(code, "Backing up data to C:\A5Backup" )
Sometimes it works fine. Sometimes some of the active records in this table disappear. Sometimes all of the active records disappear. And sometimes, some of the deleted records re-appear. I can't see any pattern - it seems to be random.
This only seems to be a problem when running the backup - I haven't been able to replicate this running a direct pack on the table in the control panel.
The table is ultra-simple - it's only accessed by the system so there are no rules or forms, and it's not part of a set. One column is indexed.
Am I misunderstanding something about record deletion? Or is this an Alpha bug?
The short-term workaround is to backup without compacting, but in the longer term crud will accumulate in the tables, so I'd like to find a solution...
I've got a table where I'm frequently overwriting ranges of records. To keep things simple, I've been deleting any existing range:
if is_existing_records = .t. then
tbl.delete_range( "prod_id="+:Product:Prod_id.value )
end if
Then I loop over the new or updated values and enter them using tbl.enter_begin(). These values have the same keys as any deleted values.
The problem comes when I run onestep_backup() with the "Compact Database" option enabled:
code = "onestep_backup();"
A5RunXbasicAfterClosingWindows(code, "Backing up data to C:\A5Backup" )
Sometimes it works fine. Sometimes some of the active records in this table disappear. Sometimes all of the active records disappear. And sometimes, some of the deleted records re-appear. I can't see any pattern - it seems to be random.
This only seems to be a problem when running the backup - I haven't been able to replicate this running a direct pack on the table in the control panel.
The table is ultra-simple - it's only accessed by the system so there are no rules or forms, and it's not part of a set. One column is indexed.
Am I misunderstanding something about record deletion? Or is this an Alpha bug?
The short-term workaround is to backup without compacting, but in the longer term crud will accumulate in the tables, so I'd like to find a solution...
Comment