Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9194259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:22:06+00:00 2026-06-17T21:22:06+00:00

I have an API which is used by a mobile app to create user

  • 0

I have an API which is used by a mobile app to create user profiles. It seems that occasionally the app is timing out and displays an error message but the server continues to create the profile. The result is that we have a few duplicate profiles.

I’m thinking that, as a ‘quick fix’ that doesn’t require a complete re-architecture I could try setting the execution time of the PHP script to match the timeout limit in the app. My question is, if this time limit is reached, can I somehow execute an ‘undo changes to the database’ script, either automatic, or one I specify?

I know I should really be looking more into why the PHP is reaching timeout limit at all (it’s a couple of minutes!), but I have already tweaked bits on the server, and mostly the execution time is just a few milliseconds. There are only a few cases of the timeout occurring. For the one example I’m looking at the minute the user is based in Israel. Is the network connectivity bad in Israel? Can anyone think of anything that could cause the behaviour I’m experiencing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:22:07+00:00Added an answer on June 17, 2026 at 9:22 pm

    One approach would be to use database transactions. I have experience in this with PostgreSQL, but I am sure MySql will do that too. You would wrap everything in a transaction. Then you can cancel the transaction when you detect failure, rolling back everything which belongs to the transaction.

    Then, you can’t catch a script timeout as it is a fatal error, however a transaction should be automatically rolled back (canceled) if it does not get committed, so you should be set…

    Maybe it could work for you?

    References:

    • http://dev.mysql.com/doc/refman/5.0/en/commit.html
    • http://www.postgresql.org/docs/8.3/static/tutorial-transactions.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that has a simple API which can be used via
I have a REST api which dumps some json data (user info, etc). Now
I have the win32 API CommandLineToArgvW which returns a LPWSTR* and warns me that
I have a very basic API in my app which also has an index
I am looking to create an effect like that which is used on The
I am programming an API that would be used by both a web app
I have some typical codes which used Twitter4J to connect Twitter API. They worked
I have a mobile app (currently IOS and soon Android) which talks to a
I have an api which takes uni code data as c character array and
I have a scenario in which I have REST API which manages a Resource

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.