Record to be updated has been changed error

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 653
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Record to be updated has been changed error

Post by jyoung » Fri Aug 10, 2018 1:32 am

I generated a new app using the new web web app templates and getting this error when trying to do an update.
capture1.PNG
capture1.PNG (18.4 KiB) Viewed 1861 times
The code that does the update is very simple

Code: Select all

srvroutine name(Save) session(*REQUIRED)
group_map for(*INPUT) group(#Fields)
field_map for(*OUTPUT) field(#STD_CODE) parameter_name(ReturnCode)

check_for in_file(XF1143) with_key(#XBUSER #XBOBJN)

if_status is_not(*EQUALKEY)
insert fields(#Fields) to_file(XF1143) io_error(*NEXT) val_error(*NEXT)
else
update fields(#Fields) in_file(XF1143) with_key(#XBUSER #XBOBJN) io_error(*NEXT) val_error(*NEXT)
endif

if_status is(*OKAY)

#STD_CODE := "OK"

else

#STD_CODE := "ER"

endif

endroutine
When the update occurs, IO$STS shows VE, which is odd as this Table as NO RULES and all the fields are populated.

This is an imported table from the IBM i and looks like this.
capture3.PNG
capture3.PNG (25.31 KiB) Viewed 1861 times
Where the attributes are
capture2.PNG
capture2.PNG (23.87 KiB) Viewed 1861 times
There is no other job/user running to change the record, and the @@UPID still has 1

Code: Select all

XBUSER	XBOBJN	XBAUTF	XBULU	XBDLU	XBTLU	@@UPID	@@RRNO
JRYOUNG   	TEST           	N	JRYOUNG   	20180809	100500	1	1
What would cause an update to do this?

EDIT
Tried on another imported table using the generated templates and got the exact same error. Tried on a LANSA table (PSLMST) and it worked.

Can someone that has IBM i imported tables run the web app templates and try an update?

User avatar
lawingo
Posts: 51
Joined: Fri Dec 04, 2015 6:41 am

Re: Record to be updated has been changed error

Post by lawingo » Fri Aug 10, 2018 5:59 am

Is the Library List of the Imported File in the User Profile that is running the Web App? Just a thought.

jyoung
Posts: 653
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Record to be updated has been changed error

Post by jyoung » Fri Aug 10, 2018 6:35 am

We are running locally so its on Windows with SQL Server, the Table was imported from the IBM i.
We can read and insert into the table, so the OAM can find it, we just cannot update or delete from it.

Interestingly, I don't have this issue with tables that I have imported and compiled before SP2. Which is why I am curious if anyone else is having this issue or if it is just us.

Thanks,
Joe

KevinW
Posts: 28
Joined: Thu May 26, 2016 11:18 am

Re: Record to be updated has been changed error

Post by KevinW » Fri Aug 10, 2018 9:42 am

Hi Joe,

This message is IOM0017. This happening is considered a validation error. This is documented under the UPDATE command in the Technical Reference Guide. This is called "crossed update checking"

Is this a LANSA file or an IBM i Other file? The reason I ask is that the output of the message is done differently.
The following is for Windows where there is a Relative Record Number column:
If a LANSA file, it is based on the @@UPID field being the same as when the row was last read. For UPDATE WITH_KEY, the row is read via a SQL where with the key, and the @@UPID & @@RRNO saved. Then the update is attempted specifying the @@RRNO and the saved @@UPID value in the SQL WHERE (also, of course the new value for the @@UPID column is incremented). If the update did not occur a further check is made as to whether the row has been deleted or is still there, using only the @@RRNO in the SQL WHERE. If the row is still there (must have a different @@UPID to the saved one) then the IOM0017 is output and I/O status is set to VE.

I am not sure why this would be occurring for you given that the @@UPID value is still 1 after all the shooting has died down.

jyoung
Posts: 653
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Record to be updated has been changed error

Post by jyoung » Fri Aug 10, 2018 10:00 am

The file is an IBMi other file in Sql Server. I read the docs regarding the cross update but I don't see how that could be happening. I have gone so far as to fetch the record first, then do the update in the next line and I still get the error.

All if our tables are "other" tables imported from the iseries. I have never stumbled on this issue before SP2.

Since this is an imported file running locally I am confident nothing else is writting to the file. The @@upid never changes.

soa
Posts: 302
Joined: Mon Dec 07, 2015 3:15 pm

Re: Record to be updated has been changed error

Post by soa » Fri Aug 10, 2018 11:01 am

Sounds like a support issue to me.

Post Reply