5 Replies Latest reply on Jul 12, 2008 7:21 AM by kstart

    Real time update

    kstart Level 1

      I have some problem to start off with my application due to real time data..... I not very sure what is the correct way to make the user side to read the MySQL database all the time to updated the latest information because I doing movement tracking so have to update all the time in the user side by accessing database. is it use Flex Data Service or use loop or what other correct way?

      Thank you....
        • 1. Re: Real time update
          atta707 Level 2
          messaging support built-in into both commerical LDS and open source BlazeDS seems a good fit for near-real time server push.

          Googling BlazeDS and messaing would give you some nice articles to read on the topic.

          • 2. Real time update
            kstart Level 1
            why does this BlazeDS got to do with Java, May I know the reason? Can I use the apache instead of tomcat?
            • 3. Re: Real time update
              atta707 Level 2
              You need some kind of server side API to get data from MySql and send it over to Flex. Flex, as you might know already, cannot connect to any DB directly. It can connect to some server 'page' or a webservice or can use remoting to get data.

              BlazeDS, as well LiveCycle Data Services, is service side impl by Adobe to help with messaging and remoting. of course, you don't have to have these technologies on the server side. Plain java servlets/jsp or .net app would do. But this is the messaging that's built-in into these server side impls that I thought might interest you.

              Otherwise, it is as simple as:
              1) set up a servlet/jsp/ASP/PHP page on the server that returns you data that you're interested in
              2) set up a Timer in the Flex app to tick after, let's say, every 5 seconds
              3) on every tick of the timer use HTTPService class to send a request to the server page
              4) listen for the result/fault events of the HTTPService class
              5) get the data in the result event and display it.
              6) timer would tick again in 5 seconds and get the newer data

              • 4. Re: Real time update
                Karl_Sigiscar_1971 Level 3

                A more advanced solution is to use the Hibernate Assember in the Data Management Services of the LiveCycle Data Services server in order to connect to your database. So, you can not only synchronize your client with your DB, but also synchronize all clients at the same time using push data. When a user on a given client changes data in a datagrid whose dataprovider is an array collection of [Managed] objects, it reflects immediately in the database as well as in all the other clients. When the DB changes (for example as the result of a backend process), all clients are sent a push data update.

                You can also use EJB3s if you write a Custom Java Assembler class, so you have a layer of abstraction and do not access the DB directly.
                • 5. Real time update
                  kstart Level 1
                  So far I have no problem inserting the data and get the data out from the database using asSQL but I not sure is this good enough for real time data? Can comment on it?

                  Thank Karl but those are every new to me as I just only student trying to do something new on Flex application and I will do research on what you post if I not sure will post here.....

                  Thank atta707 will try out the BlazeDS if I encounter problem I will post here...

                  Thank a lot for your advice.... wow learn something cool....hahaha