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

  • Home
  • SEARCH
  • 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 146979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:42:00+00:00 2026-05-11T08:42:00+00:00

In my PHP application ( constructed using symfony framework and Propel ORM), when I

  • 0

In my PHP application ( constructed using symfony framework and Propel ORM), when I add a record to the MYSQL database, I need to update an external MYSQL database using web service API provided by the external vendor.

The question is what is the best practice to maintain the database integrity. Take for example, if the first update is successful, and the second update is not, due to the fact that web service isn’t available, I must be able to either

  1. Rollback the transaction for the first update, or
  2. cache the call to the web services and keep calling to the web services until the services become available
  3. Some other techniques that can maintain the multiple database integrity.

Specifically, I am looking for syntax like

void RootMethod() {      using(TransactionScope scope = new TransactionScope())      {         try          {            SomeMethod();           scope.Complete();           CallWebService();          }          catch          {              scope.abort();           }      } } 

But not sure whether

  1. This is a good technique
  2. Or is this feasible in symfony as in C#

What do you think?

Edit: Some asked me why there is a need for two part update. It’s because I am creating a front end application connecting to an existing back end application. And I don’t want to change the back end application. So inevitably there will be some overlap. Therefore there is a need to synch the data

Another Edit: The two parts transaction must be done together, doing a cron job to synchronize the table is not desirable

  • 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. 2026-05-11T08:42:00+00:00Added an answer on May 11, 2026 at 8:42 am

    This is going to be tricky. You need 2 phase commit for a reliable solution, but that would be a ton of work to implement for your specific needs.

    Maybe a great solution is not actually called for. Are you under difficult performance constraints? Generally transactions should be short in time… but maybe you should keep the transaction open around the webservice call? This would reduce the overall throughput of the database (at the least)… but that might be perfectly acceptable.

    The approach you showed will have problems handling hard system failures (power failures, hardware faults, etc). To work around that you’ll need to add tracking to your main database and a background process/startup process to handle failures. Pretty fiddly to do, but certainly possible.

    Some failures might end up not being fixable (first part succeeded, second part failed, first part can’t be undone because another transaction has updated the same data). It all depends on your precise business rules. An accounting system would be the easiest because undo’ng a transaction is actually done as offseting records and not updates.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 113k
  • Answers 113k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming that the original assembly is not signed and the… May 11, 2026 at 10:04 pm
  • Editorial Team
    Editorial Team added an answer Actually I found the answer in the "Maven: The Definitive… May 11, 2026 at 10:04 pm
  • Editorial Team
    Editorial Team added an answer just a simplification of Pim's (edited to pull up James… May 11, 2026 at 10:04 pm

Related Questions

I'm writing a PHP application with testability in mind, so my classes always ask
I am retro-fitting an application to make use of a PHP HTTP proxy (for
I have a few classes, such as those that outline database table structure or
I need to put an LDAP contextSource into my Java EE container's JNDI tree

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.