8 Replies Latest reply on Apr 24, 2009 5:01 AM by rjoshicool

    Multi user access and Flex HTTPService and PHP

    rjoshicool Level 2

      Hi,

       

      I am developing a Flex application with PHP as a server side technology. I am using HTTPService to send and receive data to and fom PHP. When I want to receive a result, I send request to a particular PHP URL and handle the result in the Resut Event of the HTTP Service, which is in th form of an XML. The problem is, if more than 1 user tries to perform same operation simultaneously, then result is being send to same PHP url. But each user might have requested the URL in different manner. So how can i check that the result sent to a user is same as what he requested for and doesn't conflicts with any other user.

        • 1. Re: Multi user access and Flex HTTPService and PHP
          Madhav Subedi Level 4

          hi,

           

          this is the headache of something called WEBSERVER.... not us. for a web server, all requests are distinct from each other. you dont have to worry about it. to identify the user in php, you can pass the user identification as Request parameter to php.

           

          hey, one more thing.. millions of people use YAHOO mail. when you and me login to YAHOO EXACTLY AT THE SAME TIME, do I see your email messages? I think no..

          • 2. Re: Multi user access and Flex HTTPService and PHP
            rjoshicool Level 2

            Hi,

             

            Thanks for the reply. I unserstand that this part would be taken care by the webserver. But I would like to explain my problem again -

             

            lets say i login as user 'a' and i go to a page where on the click of an item in datagrid, some details get filled in particular fields. This happens by sending a HTTPService request to say url "http://123.com/something.php". Now user 'b' has also logged in but clicks some other option in the datagrid by sending request through same HTTPService request through his system to same url- "http://123.com/something.php". Now if the result rendered on the url is <abc>123</abc> for user 'a' and <abc>456</abc> for user 'b' and both requests were sent simultaneously, then what will each user see?

            • 3. Re: Multi user access and Flex HTTPService and PHP
              Michael Borbor Level 4

              Each user will get what each user requested, it doesn't matter if 2 people or 2000 people make the request at the same time. If like when you visit a web page, you see what you request through your browser.

              1 person found this helpful
              • 4. Re: Multi user access and Flex HTTPService and PHP
                Michael Borbor Level 4

                Although when requesting data is not an issue, it'll be an issue if n number of user will want to update the same data at the same time, then you'll have to validate. maybe add locks to the DB, but those are the same concerns that you'll have if you were developing a web page.

                • 5. Re: Multi user access and Flex HTTPService and PHP
                  Madhav Subedi Level 4

                  "Now if the result rendered on the url is <abc>123</abc> for user 'a' and <abc>456</abc> for user 'b' and both requests were sent simultaneously"

                   

                  to make you clear, it cannot be SIMULTANEOUS from the database management system perspective.

                   

                  The DATA is LOCKED while some update is in progress, the LOCK is not released until the WRITE operation is finished. For simultaneous requests, it is now HEADACHE OF DBMS.

                  1 person found this helpful
                  • 6. Re: Multi user access and Flex HTTPService and PHP
                    rjoshicool Level 2

                    Ok, i think you people are correct but still one thing is making me think again and again over it. The answer of this might be there in what you have explained earlier but I just want to clear everrything.

                     

                    user 'a' sent a request to a url, user 'b' also sent a request and the data rendered on the url, as per b's request was was <abc>456</abc>, So won't a alos see the same result?

                     

                    I have worked on quite a many Flex applications but this is the first time I am working on a multi-user application with a PHP backend. I need to convince the PHP developer that he just needs to send the data to me in XML form at a URL and I'll handle it. Also does he need to sreate sessions in order to check which request came from where?

                    • 7. Re: Multi user access and Flex HTTPService and PHP
                      Michael Borbor Level 4

                      No they won't, it's the same stuff like you have when you browse the internet, your ISP must have thousands of users, but when you request forums.adobe.com you'll get this site, not what your neighbor requested. It's like a phone call when you dial a number, it rings, and then someone answers you, is a  one-to-one conversation.

                      • 8. Re: Multi user access and Flex HTTPService and PHP
                        rjoshicool Level 2

                        Thanks for the replies, that really helped. If anyone has link to some example or tutorial on flex, php and sessions then please let me know.