record changed by another user

rb1234

Member
i use doa, delphi 5 with midas.

i do a lot of the following:

ds.datarequest('select bez from table where nr = 1');
ds.fieldbyname('bez').value := 'new';
ds.apply_updates;
(bez is a memo field)

mostly it works fine, but sometimes, with some records, i get the error 'record changed by another user'.

there is definitely no other user who changed anything. the records where the aplyupdates failed seem not different from others, i can't see any special.

i played around with oracledataset.lockingmode and oracledataset.refreshoptions. nothing helped.

i can't understand what happens there, why it sometimes work and sometimes not.
what could be a reason for this error message?

ralf
 
it seems to occur by chance.

i use a midas server with doa but i still have my old bde midas server.

in my app i read records from a text file to oracle tables. each file has about 1000 records. i do a datarequest for each record, change some fields and then do an apply.
every some thousend apply's i get the 'record changed by another user' error. i don't hav any idea what the course of the error could be. in my test environment there is no other user and mostly it works.
i overcome this with using my bde server for the file where the error occure, after this use my doa server again.

so doa seems just a bit 'unstable' for me. with the bde server i never get this error (i get other errors and that's why i want to move to doa).

any idea?

regards,
ralf
 
This can only happen if the record in the database is different from the record in the result set of the dataset. If you are sure that nothing has changed in the database, then maybe the select statement uses a function on one or more select list items? You could for example have used an Upper function on a column, and use the original column name for the alias:

select deptno, upper(dname) dname, loc from dept

If the value of a dname column is not all uppercase, the dataset would think that this column has been changed by another user.

These are the only 2 things I can think of: the record is in fact changed in the database since it was fetched, or the select statement modifies the column values.

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