2 Replies Latest reply on Nov 23, 2010 6:14 PM by Dizzot

    CFAir Syncmanager Error #1009 on successful commit

    Dizzot

      I am building an offline air application which uses the new cfair Syncmanager. I have the latest Coldfusion 9.0.1 build running and have flex pointed to the updated cfair.swc. In my application I have many object relationships (many-to-many, one-to-many, etc) and all of them seem to be setup successfully as my initial syncmanager.fetch fires off to the coldfusion server correctly and stores all test objects to the local sqlite database. Also when running a session.load from the local database all test objects load from the local sqlite database successfully. However, my problem happens when running a session.commit after creating a new object on the client. What happens is the commit fires successfully, the coldfusion server saves the new object to the database and the commit success function fires with a SessionResultEvent being passed. However I also get this message:

       

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
            at <anonymous>()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\cold fusion\air\SyncManager.as:564]
            at mx.rpc::Responder/result()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:5 6]
            at coldfusion.air::SessionToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\coldfusion\air\Ses sionToken.as:210]
            at coldfusion.air.events::SessionResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\coldfusion\air\eve nts\SessionResultEvent.as:127]
            at coldfusion.air::Session/dispatchSessionResultEvent()[D:\p4\depot\ColdFusion\cf_main\tools \AIRIntegration\OfflineSupport\src\coldfusion\air\Session.as:3582]
            at <anonymous>()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\cold fusion\air\Session.as:3242]
            at mx.rpc::Responder/result()[E:\dev\4.0.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:5 6]
            at coldfusion.air::SessionToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\coldfusion\air\Ses sionToken.as:210]
            at coldfusion.air.events::SessionResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\coldfusion\air\eve nts\SessionResultEvent.as:127]
            at coldfusion.air::Session/dispatchSessionResultEvent()[D:\p4\depot\ColdFusion\cf_main\tools \AIRIntegration\OfflineSupport\src\coldfusion\air\Session.as:3582]
            at <anonymous>()[D:\p4\depot\ColdFusion\cf_main\tools\AIRIntegration\OfflineSupport\src\cold fusion\air\OperationsTableManager.as:446]

       


      What is funny is that everything seemed to work. The new object is now stored in both the local sqlite database and the remote server database, and the commit success event fired. The local session also contains the new object, and when I do a session.load it loads the new object with the rest of the data. What could be the cause of this error, or what is the best way to debug it as I can't look at what is going on in the SyncManager.as file.

        • 1. Re: CFAir Syncmanager Error #1009 on successful commit
          Dizzot Level 1

          Alright, so after banging my head against the keyboard for several days, I figured out that this error seems to happen if I have the relationships [many-to-one, many-to-many] set as ArrayCollection instead of Array. Even though I had the serialize-array-to-arraycollection set to true in the services-config xml for ColdFusion. I'm guessing this is a bug, could someone confirm this or am I missing another setting? I noticed that coldfusion.air::Session has a property (private maybe?) that say's useArrayCollection, and it's set to false. I would like to use ArrayCollection because I am binding to those properties and I need to know if they change, but any ideas?

          • 2. Re: CFAir Syncmanager Error #1009 on successful commit
            Dizzot Level 1

            After further testing it seems that using an ArrayCollection is what is causing this problem, by changing everything to Arrays and the serialize-array-to-arraycollection to false did things work correctly without error. Should I submit this as a bug? And if so which area, Coldfusion (CFAir is installed with Coldfusion) or Flex (Maybe the ones that wrote it??)