OracleDataSet OnEdit, OnDelete

DAVIDSS

Member²
When I try to Edit or Delete a record, the OracleDataSet raise an exception "Record Has Been Deleted by Another User"

Note: All properties have the default values in Session and OracleDataSet

------------------
David Samayoa Solis
Analista Programador
 
Can you enable the TOracleDataSet.Debug property to verify the query that is executed which leads to this conclusion?

You will see a select statement, based on the rowid of the record that you are trying to edit/delete, which returns 0 rows.

------------------
Marco Kalter
Allround Automations
 
When I press the Delete button from the navigator the debugger show me this:

- savepoint DOA_LOCKPOINT

- select * from IMS_MARCA where
rowid =
biggrin.gif
OA_ROWID for update nowait

-
biggrin.gif
OA_ROWID = AEDkAADICDBAr4AAAA

- rollback to savepoint DOA_LOCKPOINT

Then the same message:

Record has been deleted by another User

what do you think?

------------------
David Samayoa Solis
Analista Programador
 
Does this record with rowid 'AEDkAADICDBAr4AAAA' exist?

------------------
Marco Kalter
Allround Automations
 
Well, I put this OnBeforeDelete:

if OracleDataSet1.SearchRecord('ROWID', OracleDataSet1.RowId, [srFromBeginning]) then
ShowMessage('Yes');

ShowMessage(OracleDataSet1.RowId);

And the message say "Yes", then the other show the AEDkAADICDBAr4AAAA

That means... yes, there is that row...

Maybe the db or the user needs some aditional properties in Oracle 8i?

------------------
David Samayoa Solis
Analista Programador
 
Please, I need an answer...

I'm losing money Here.....

------------------
David Samayoa Solis
Analista Programador
 
Try it again, and when you get the row id, open up SQL Plus and execute the following:

select *
from IMS_MARCA
where rowid = 'THE ROW ID HERE'

and see what you get. Chances are the rowid has become invalid. When DOA loads an editable result set into memory, it loads the row id's with it and uses them to send updates to the server. If a row is nearly at the capacity of the block, and more data is inserted into the row, then Oracle may migrate the row to a new location, thus invalidating the rowid fetched earlier.

You may try your own update on the table using a true key name instead of the rowid. That way, no matter where the row is, it will get updated.

Use the following syntax:

update IMS_MARCA
set somecolumn = 'newvalue'
where somecolum = 'the key'

Make sure to commit your changes.
 
I Found the answer!!!!

in Designer6i, in table properties/advanced, there is a propertie named Index_Organized, the value most be NO, and the indexes in the model most have a TableSpace dedicated....

then generate the model in DBAdmin....

This most be in the documentation of DOA....

------------------
David Samayoa Solis
Analista Programador
 
Just FYI...

An index-organized table stores the values of the rows inside the index (on the primary key). Adding or removing items from the table causes the index to re-balance, thus invalidating the rowid.

Index-organized tables will not work with DOA's TOracleDataset using ROWID's to update data. If you need to use a TOracleDataset, then code your own update and delete routines using the real primary key, not the row id.

I agree this should be documented in the help file...
smile.gif


Eric
 
Thanks for your help Eric and Marco...

Despues de todo seguire luchando con estos componentes....

------------------
David Samayoa Solis
Analista Programador
 
Back
Top