Record has been changed by another. Cancel the operation and refresh the record first

mschroeer

Member
We habe some trouble with few rows.
We get anytime following error message on these rows:
"Record has been changed by another. Cancel the operation and refresh the record first"

We habe an Oracle Database with CharachterSet WE8ISO8859P15
and the client has the same.

Delphi XE3 and DOA 4.1.3.5 with Session Parameters:
BytesPerCharacter: bcAutoDetect
ConvertUTF: cuUTF8ToUTF16
ForceWideStringFields: True

So if we use CheckImmediate in the OracleDataSet we get the Errormessage on some rows. If we use LockImmediate, we don't get the error message.

We think, the compare routine don't work everytime correctly, if the database use ASCII and the Delphi Programm use Unicode.

With "forcewidestringfields = false" an no TWideStringFields we had no error.

 
Last edited:
Dataset SQL:
select eido.A_PA0055_05.*,eido.A_PA0055_05.rowid from eido.A_PA0055_05
where eido.A_PA0055_05.aktennr = :PATENT_NR

****

Create or Replace View A_PA0055_05
AS
select "PATENT_NR" as aktennr,"PUBLIKATIONS_NR","ANMELDE_DATUM","BEMERKUNG","ANMELDER","KATEGORIE","E_TYP","LINKAKTENNR","LINKAKTENTYP","NUMMER1","NUMMER2","DOKU_NR","NUMMER3","ZAEHLER",DATUM1 from PA0055;

****

Create Table PA0055
(PATENT_NR NUMBER(38,0) NOT NULL
,PUBLIKATIONS_NR VARCHAR2(1024) NOT NULL
,ANMELDE_DATUM DATE
,BEMERKUNG VARCHAR2(4000)
,ANMELDER VARCHAR2(80)
,KATEGORIE VARCHAR2(25)
,E_TYP NUMBER(1,0)
,LINKAKTENNR NUMBER(38,0)
,LINKAKTENTYP VARCHAR2(1)
,NUMMER1 VARCHAR2(10)
,NUMMER2 NUMBER(4,0)
,DOKU_NR NUMBER(38,0)
,NUMMER3 VARCHAR2(255)
,ZAEHLER NUMBER(38,0)
,DATUM1 DATE
);

 
Dataset SQL:
select eido.A_PA0055_05.*,eido.A_PA0055_05.rowid from eido.A_PA0055_05
where eido.A_PA0055_05.aktennr = :PATENT_NR

****

Create or Replace View A_PA0055_05
AS
select "PATENT_NR" as aktennr,"PUBLIKATIONS_NR","ANMELDE_DATUM","BEMERKUNG","ANMELDER","KATEGORIE","E_TYP","LINKAKTENNR","LINKAKTENTYP","NUMMER1","NUMMER2","DOKU_NR","NUMMER3","ZAEHLER",DATUM1 from PA0055;

****

Create Table PA0055
(PATENT_NR NUMBER(38,0) NOT NULL
,PUBLIKATIONS_NR VARCHAR2(1024) NOT NULL
,ANMELDE_DATUM DATE
,BEMERKUNG VARCHAR2(4000)
,ANMELDER VARCHAR2(80)
,KATEGORIE VARCHAR2(25)
,E_TYP NUMBER(1,0)
,LINKAKTENNR NUMBER(38,0)
,LINKAKTENTYP VARCHAR2(1)
,NUMMER1 VARCHAR2(10)
,NUMMER2 NUMBER(4,0)
,DOKU_NR NUMBER(38,0)
,NUMMER3 VARCHAR2(255)
,ZAEHLER NUMBER(38,0)
,DATUM1 DATE
);
 
We had similar problem and after investigating, the problem seemed to be that we used setting

SyncFieldSizes := True

to force synchronizing between DB and client string field lengths, but procedure SyncStringFieldSizes checked only against

if DataType = ftString then

instead of

if DataType in [ftString, ftWideString] then

So comparison of a string field old and new values could fail if their lengths differed in DB and client when using WideStrings. And that would result in 'Record has been changed etc...' error.

So the solution in our case was either make sure that the lengths were same or change the source like above..

:)
 
Last edited:
Back
Top