3 Replies Latest reply on Feb 8, 2010 10:37 AM by Ansury

    Refreshing Problem

    venkateshk Level 1

      I am using flex as a front end for my application middle tier is java

      I am getting the values from DB it's fine

      But if I change the DB values and come to my application then click on refresh button

      I am seeing old values only I am not getting the updated values

      I tried with navigateToURL and calling  this in <mx:Application>

      but it's results in continuous loop

      I want only when that if the DB values are updated then that should reflect on my application automatically

      Please help me..............

      It's very pain to me

        • 1. Re: Refreshing Problem
          Ansury Level 3

          How are you getting data from the server to Flex?  RemoteObject, messaging, etc?

           

          It sounds like you want to use messaging (to do a "server push" on a db update), i.e. have the Flex client subscribe to a messaging service ("consumer").

           

          Have you tried using either the Flex or Java debuggers to see what's going on yet?

          • 2. Re: Refreshing Problem
            venkateshk Level 1

            I am using RemoteObject

            --

            Venky

            • 3. Re: Refreshing Problem
              Ansury Level 3

              So every time your Flex app initializes, it makes a call to the server (which returns a different value), but the value is always the same?  If your database query code is working correctly (as you've said) and you're returning different values from Java, Flex has to be getting those different values, there is no caching magic or anything going on.  Do you know how to use the debuggers to verify everything is working?  Are you sure any Flex bindings you have are working correctly?  It's hard to guess at the problem without more information.

               

              Are you aware that RemoteObject will not automatically update your Flex objects when they change on the server?  To "refresh" values automatically via RemoteObject you'd have to use a timer (or a manual "refresh button" in Flex) to call the remote Java method that gets the current value again.  If you want an automatic update via RemoteObject using a timer to make repeated calls will work fine, but it's probably not ideal since it requires extra network calls.  You'd basically be doing "polling" style updates (slower) instead of a server push via a messaging Consumer (faster).

               

              Messaging (if you want to switch to using a Consumer)

              http://www.adobe.com/devnet/flex/articles/intro_fms_05.html