1 Reply Latest reply on Sep 28, 2011 7:07 AM by 2rrrr

    Slow response time on servers




      I have a problem with response times between java -> flex. When I test the program on my development machine everything is fast, but on test servers it slows down.


      My java method is called using a RemoteObject, and I can see that the method is called and that it fetches data from Hibernate fast, and then returns an array of 30 objects. But then something happens before the data is returned to the client. I guess the serialization process is slowing it down, but I have no idea why. It takes nearly 10 seconds before the handler method is triggered on the client.


      I use flex 4.5, BlazeDS 4 and Spring-flex 1.5.


      From services-config.xml:

              <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
                  <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>


      Hope somebody can help me?

        • 1. Re: Slow response time on servers
          2rrrr Level 1

          I had another go at fixing this problem, and I found a workaround for the problem, but I still do not understand why I have to do this.


          When I try to return an object annotated with javax.persistence.*, Spring converts the object values:

          11:33:00:819 - DEBUG - ? - Actual type of value for property 'testing' on instance com.test.TestClass@299e299e is class java.lang.String

          11:33:00:826 - DEBUG - ? - Converting value 'valueTest' of java.lang.String to @javax.persistence.Column java.lang.String

          11:33:00:830 - DEBUG - ? - Converted to 'valueTest'



          So it is taking too long to complete because of this. If I create an object without the javax.persistence.* annotations and copy all the values to this class before returning everything works as it should. Can someone explain why this happens?