I have noticed HXTT is permanently deleting the records in FoxPro. Is there an option/flag to mark it for deletion?
Within FoxPro deletion is a two-step process. First the record is marked for deletion then you issue a PACK command to permanently remove the record. See image below showing records marked for deletion when browsed in FoxPro
The PACK command requires exclusive access to the table. I am curious as to how this is being done in HXTT when the table is in shared use.
We have been using HXTT for a few years, and never realized that deletion in Foxpro is a two-step process, and I was wondering if the way that HXTT does deletions causes performance issues while doing deletes.
You can use deletesAreVisible=true connection property to see the deleted rows.
deletesAreVisible: Indicates whether DBF's resultSet includes deleted records. false
DELETED([cTableAlias | nWorkArea]): returns a logical value that indicates whether the current record is marked for deletion.
I'm aware of the deletesAreVisible flag, my question, more precisely, is what does HXTT do when it receives an SQL statement that calls delete for a number of records. Are those records simply marked for deletion, or does HXTT do a mark for delete followed by a pack to actually delete the records from the table. I think it is doing the latter, because the records I'm deleting are in fact removed from the table. I'm asking because I'm trying to isolate a performance issue, and I'm trying to rule out a speed degradation due to the need for an exclusive lock to do the pack operation after a mark for delete.
> Are those records simply marked for deletion,
Yeah. If deletesAreBlank=false(default connection property), you can undelete it. If deletesAreBlank=true, it becomes a blank data row.
deletesAreBlank Indicates whether one destination data record will become one deleted blank record when delete it. false
>does HXTT do a mark for delete followed by a pack to
>actually delete the records from the table.
Pack Table sql can do it, but HXTT DBF markes a deleted flag.
>because the records I'm deleting are in fact removed from the table.
You can see those deleted rows if you use deletesAreVisible=true connetion property in that(or latter) connection.
>the need for an exclusive lock to do the pack operation after a mark for delete.
Yeah. Pack table sql need an exclusive lock.