Delete of record

Sven

Member²
Hi Marco,

if i delete a record with TOracleDataSet.Delete the following is done by DOA

1. create savepoint
2. reads ALL data of the record "for Update"
3. Delete record with rowid
4. commit

Why does DOA reads all! data in 2. ?
In my case it reads all longs and lobs, but this is not needed and on a slow ip-connection line it tooks very long.

Greetings
Sven
 
It reads all data because this is a combined function that locks the record and checks if it has been changed.

------------------
Marco Kalter
Allround Automations
 
Yes,

but assume the following SQl-Statement

select id, name from tablename

to delete a record DOA makes
select * from tablename.

If there are a lot of clob or long field, this take on a 64 k line very much time.
(and DOA can only compare the fields id and name)

Sven
 
In that case the CLOB data will not be read, just the record data. But I see your point. Why should you fetch all columns when only a few need to be compared. The roAllFields option of the RefreshOptions causes these refresh, compare and some lock operations to re-execute the original SQL statement, with the where clause extended with the rowid. Unfortunately this does not affect the lock operation for a delete. I will add this to the enhancement requests.

------------------
Marco Kalter
Allround Automations
 
Back
Top