Jump to content

Recommended Posts

GeoSteven    0

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
ggt667    8
Posted (edited)

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
Wim Decorte    455
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
GeoSteven    0

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


  • Similar Content

    • By ggt667
      What is wrong when Database appears unavailable to the scheduler, yet regular users are logged in?
    • By Colin Hunter
      I'm running FMS 11.0.5.510 on OS X 10.9.5. It's serving forty databases, one of which is served to the web via custom web publishing. Everything is running smoothly but the campus security auditor is picking up a vulnerability with the old version of OpenSSL running on OS X 10.9.5's Apache. I addressed this on a different, non-FMS Mac by disabling Apple's bundled Apache and using MacPorts to install Apache2.
      How to do this on my FMS 11 Mac? Just getting MacPorts to install Apache2 is the first problem as port install apache2 fails with a conflicting ports message. I assume this is because the existing Apache is blocking installation of the new version but how to stop the existing one? I tried turning off web publishing in the FMS admin console but port install still fails with the familiar conflicting ports message. Even stopping the web server with Mark Banks' FMSControl didn't help.
      I therefore have a couple of questions:
      How do I stop the existing Apache so MacPorts will install Apache2? Once I have Apache2, how do I get FMS11 to use it instead of Apple's bundled Apache1? Thanks
      Colin
    • By imdarek
      Hi, I am using filemaker 11 to copy customer info from excel into the database and then it would generate special keys in pdf allowing us to send the file to the customer.
      My access to the filemaker is non-admin, and the import function of customer info has been blocked.
      We are keying in the record one at a time, so we are looking at ways to automate this process.
      When I try to create a new record using applescript with just 
      it was not allowed. There are data that require validation like date and auto-indexed record number.
      So, is there a way we could create new record and then using the set function to copy data into the report?
    • By ggt667
      How can I get ESS access to PostgreSQL from FM11SA?
    • By gczychi
      Hi,
      accessing external SQL resources from within FileMaker is quite common. But how do I go about the exact opposite?
      I have an import_nwde:: table in a fmp12 file hosted on FMS 15.
      I have switched on ODBC in FMS.
      I can access the tables with Windows and Mac (using the Filemaker ODBC drivers specifically installed to do this).
      But how can I write into this table from within a MySQL database running on a LAMP machine? Whenever something happens on the website, I need to process the data in FileMaker.
       
      Thanks a lot for any help,
      Gary
×

Important Information

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