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 8808011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:30:44+00:00 2026-06-14T02:30:44+00:00

My application is backed by a complex database architecture, heavy in foreign key restraints

  • 0

My application is backed by a complex database architecture, heavy in foreign key restraints which result in my JavaScript being riddled with callback handlers. For a single action, such as creating a new order, there may be as many as three XHR’s required to submit all the necessary data for processing.

Currently, I am handling this in what I feel is a rather ungraceful or at the very least, a bit sloppy means…

/** -- PSEUDO CODE -- */
myOrder.save({
    success: function()
    {
         /** This request handled inserting the main attributes of the model
             into the database, which means it is safe to fire off additional
             requests */
         myOrderContents.store.sync({
                success: function()
                {
                    /** Possibly fire another request here, that is dependent on
                        the first two requests returning successfully, or maybe
                        execute code that is also dependent on these requests.
                      */
                }
         });
    },
    failure: function()
    {
    /** Handle Failure Here */
    }
});

I realize another viable approach would be something along the lines of all requests calling one callback method, which would then only execute a certain chunk of code….

myOrder.save({callback: executeAfterRequests});
myOrderContents.store.sync({callback: executeAfterRequests});
myOtherObject.save({callback: executeAfterRequests});

executeAfterRequests: function()
{
    if(requestA.isComplete() && requestB.isComplete() && requestC.isComplete())
    {
    /** Execute some code after all requests have been completed... */
    }
}

Given that ExtJS dev’s are strongly opposed to synchronous request, is my best bet here to extend the base AJAX class and implement a Queue? Or, accept the nature of AJAX and continue on my merry way with nested success functionality?

Thank you for your input.

  • 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-14T02:30:46+00:00Added an answer on June 14, 2026 at 2:30 am

    Why not send all of the needed data to the server together? You can create your records in steps on the server and return when all is done.
    There are examples out there with form wizards that can take users through a long process of collecting data screen by screen but submits all of it at the end.

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

Sidebar

Related Questions

I have a database-backed application which, sadly, has very few tests of its database.
I am running a Spring MVC application, backed by a MySQL database which I
I want to use a javascript framework with MVC for a complex web application
My VB6 application is backed by a MS Access database. Allowing user to open
We're considering re-factoring a large application with a complex GUI which is isolated in
I am writing a standard database-backed business application. Assume that I work with bank
We are developing a Java EE application backed by any database of customer choice.
Consider, please this setup for a database backed application. ( in my case DB
I have GPS Tracking application main goal is saving GPS coordinate to backed database
I have an Android application, backed by an API. To this API users can

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.