2 Replies Latest reply on Sep 27, 2010 9:05 AM by bsandhu2010

    'Null' being added to ArrayCollection during add/update by Dataservice

    bsandhu2010

      Environment:

      • Tomcat 6.0
      • Livecycle 3.1
      • Flex SDK 3.5

       

      We have a data service destination setup like this:

           <destination id="Trades" adapter="java">
              <properties>
                  <factory>spring</factory>
                  <source>lcdsTradeBlotterAssembler</source>
                  <scope>application</scope>
                  <item-class>com.domain.Trade</item-class>
                  <use-transactions>false</use-transactions>
                  <auto-sync-enabled>true</auto-sync-enabled>
                  <cache-items>true</cache-items>
      
                  <metadata>
                      <identity property="uid" type="java.lang.String" />
                  </metadata>
      
                  <network>
                      <throttle-inbound policy="IGNORE" max-frequency="500" />
                  </network>
              </properties>
          </destination>
      

       

      We implement a custom assembler by extending the AbstractAssembler.

           The fill and refreshFill methods are implemented.

       

      Updates are pushed to the client using a DataServiceTransaction:

           DataServiceTransaction transaction = DataServiceTransaction.getCurrentDataServiceTransaction();
           transaction.createItem(DESTINATION, trade);
           transaction.commit();
      

       

       

      After we create items and push them from the server, the refresh method on the Assmbler gets called. We return 'APPEND_TO_FILL'.

      The item shows up in the client side managed ArrayCollection. This ArrayCollection is bound to a datagrid.

       

      Problem description:

       

      The above works fine when we run the server and the client locally on the same machine. When the application is hosted on a another part of the network - we see that for some of the updates - a null gets added to the ArrayCollection, instead of the object pushed from the server. We found this by attaching a CollectionChange event listener to the managed ArrayCollection. This causes blank rows to show up in the Blotter. In some cases we have also seen duplicate rows.

       

      We see that the object is delivered to the client but not applied to the ArrayCollection properly. I attached a screen shot of the client side stack where we loose the update.

       

      ScreenHunter_05 Sep. 13 17.39.gif

       

      Calling the refresh() method on the ArrayCollection after the update, fixes the situation. The nulls disappear and the ArrayCollection now has the right data !

       

      Things tried so far:

      1. Throttling the DataService update rate - down to 1 update/sec
      2. Enabling reliable delivery on the Dataservice destination
      3. Handling conflicts - none detected. Client never updated data.
      4. Setting DataService.resetCollectionOnFill property to true

       

      Any pointers would be very helpful