Jump to content
GeoSteven

FMSA 11 - error 512

Recommended Posts

I am running a server side script that attempts to update records in a MySQL table that is set up as an external data source. It runs without issue for hours to weeks at a time then gets hung on error 512 (Record was already modified by another user). The problem is that I can't figure out how to capture and handle this error. I've tried adding "If get(lasterror)=512 then <skip this record and continue to next> just after the 'Go to Record(next)' but it never gets to that step. Instead hangs on try to move the record pointer and writing error after error to the log. 

I've searched the forums fairly thoroughly but there is not a lot of info forthcoming. Surely this has been a problem for someone else that has figured out how to handle it. Any suggestions appreciated.

Will be glad to provide more info on the environment if needed.

Thanks in advance,

Steve

Share this post


Link to post
Share on other sites

512

Record was already modified by another user

 

 

You say nothing about how you UPDATE the data.

Which OS does the machine that runs FM11SA run?

When I do what you describe I export a selection of data AS XML and do an XML / XSLT / tr -d / tidy / xsltproc transformation on the command line and then do an UPSERT based on recid / modid.

Edited by ggt667

Share this post


Link to post
Share on other sites
12 hours ago, GeoSteven said:

 I've tried adding "If get(lasterror)=512 then <skip this record and continue to next> just after the 'Go to Record(next)' but it never gets to that step. Instead hangs on try to move the record pointer and writing error after error to the log. 

 

 

We would need to see your script to be more helpful but try the error capture immediately after the first Set Field.  Or perhaps even do an "open record" before attempting to write to it.

Share this post


Link to post
Share on other sites

Sorry for my delayed response. ggt, I am updating the record using a 'set field' command. I was able to capture the error as needed by using Wim's suggestion of placing an 'open record' step before the "set field" step.

However, the underlying problem, which I found while gathering info to give you both feedback, was that I am looping through a found set of records. When a certain condition is met I call a subscript to add/replace a record in a related table. In that subscript I was also updating the field in the parent table (from the related one) then, upon returning to the calling script I attempted to update the field again (in the parent table). Hence the error 512. The reason it would only fail occasionally is that the 'certain condition' would only be met occasionally.

I removed the step in the subscript to update the parent table so that it was only done in one place. For extra measure I added the 'open record' step as suggested by Wim.

Thank you both. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×

Important Information

By using this site, you agree to our Terms of Use.