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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:06:26+00:00 2026-06-14T05:06:26+00:00

I am currently working on a Symfony2 project that at some point involves submitting

  • 0

I am currently working on a Symfony2 project that at some point involves submitting a form and performing a lengthy operation on the filesystem (recursive copy).

At the moment, the user has to wait until the filesystem operation is finished and form processed before being redirected. I have tried enhancing this functionality by using some simple AJAX. I have run into trouble of not being able to perform a form submission and querying another action/controller concurrently.

Does Symfony2 allow concurrent controller requests? If it doesn’t, is there any way to complete achieve something that would work like basic concurrency?

This is the outline of what I am trying to do in terms of code:

<form action="{{ path('performSomeAction', { 'id': client.getId(), 'someId':some.someId() }) }}" method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}

<input type="submit" />

And this is what I am trying to do concurrently to submitting the form, using asynchronous XMLHttpRequest:

<script language="JavaScript" type="text/javascript">        
        function getXmlHttpRequestObject() {
            if (window.XMLHttpRequest) {
                return new XMLHttpRequest(); //Not IE
            } else if (window.ActiveXObject) {
                return new ActiveXObject("Microsoft.XMLHTTP"); //IE
            } else {
                alert("Your browser doesn't support the XmlHttpRequest object. ");
            }
        }

        var receiveRequest = getXmlHttpRequestObject();

        function handleFetchProgress() {
            if (receiveRequest.readyState == 4) {
                var newData = receiveRequest.responseText;
                var oldData = document.getElementById("span_result").innerHTML;
                var toDisplay = oldData +  "<br />" + newData;
                document.getElementById("span_result").innerHTML = toDisplay;
            }
        }

        function fetchProgress() {     
            if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
                receiveReq.open("GET", '{{ path('fetchProgress') }}', true);
                receiveRequest.onreadystatechange = handleFetchProgress;
                receiveRequest.send(null);
            }         
        }

        $(document).ready(function() {
            $('form').submit(function() {
                setInterval("fetchProgress()", 1000);
                return false;
            });
        });

  • 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-14T05:06:27+00:00Added an answer on June 14, 2026 at 5:06 am

    This is probably caused by session lock and is explained here : How do I kill a session in Symfony2?

    You have to unlock session write mode to admit another request to access it.

    I wrote a blog post about dealing with asynchronous requests : http://blog.alterphp.com/2012/08/how-to-deal-with-asynchronous-request.html

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

Sidebar

Related Questions

On a current project which I'm currently working, i have a symfony task that
I'm currently working on a symfony2 based project with lots of ajax usage. Now
Currently working on a project that is being developed in VS2010. I'm running Windows
I'm currently working with Symfony2 and I'm testing my project with PHPUnit. I want
hello Im working on a symfony project. Im battleling with a form that wont
I'm currently working on a project that uses Kohana 3.2. I haven't used the
I'm currently working on a project with symfony 1.4 and Doctrine 1.2. I'm looking
Currently working with converting SQLException error messages into messages that are more useful for
Currently working on a VBScript to automate some of the dirty PST ingestion work
Im currently working on a game that uses multi touch to apply zoom to

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.