0 Replies Latest reply on Nov 9, 2010 1:15 PM by zhijiang@chen.me

    Problem with Adobe AIR Offline sync with ColdFusion server

    zhijiang@chen.me

      I having problem to sync with local and remote db, environment.

      - Flex Hero.

      - Coldfusion 9.0

      - MySql 5

       

      The GlobalVars follow same as http://www.adobe.com/devnet/coldfusion/articles/offline_air_orm.html.

      The problem is when I create a user (entity at both size), it can be stored in local db without problem, but the session.save(obj) process didn't trigger commit to remote server (ColdFusion), (SyncManager.autocommit = ture), I tried set AutoCommit = false then use session.commit() to manually commit it, it didn't work neither.

       

      Anyone have same problem?

       

       

      Thanks in advance.

       

      Cow.

       

       

      GlobalVars.as (part):

      
      
      
      
      
      
      
      
      
      
      //public static var syncmanager:SyncManager = new SyncManager();
                public static var Port:int=8500;
                public static var Server:String="localhost";
                public static var serverCFC:String = "DonkeyTravel.services.cusManager";
                public static var CurrentPage:String;
                
                public static var dbFile:File =File.userDirectory.resolvePath("CustomerManager.db");     
                public static var dbDir:File;     
                public static var CacheInt:int = 1;
                public static var Online:Boolean = false;
                public static var OnlineImage:String = "/assets/ball-32.png";
                public static var OfflineImage:String = "/assets/ballred-32.png";
                public static var Changes_present:String = "/assets/32TRUE.png";
                public static var On_Off_Image:String;
                [Bindable]
                public static var productListComboItems:ArrayCollection = new ArrayCollection();
                [Bindable]
                public static var CustomerListComboItems:ArrayCollection = new ArrayCollection();
                public static var myTimer:Timer = new Timer(15000);
                myTimer.start(); 
                myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
                
                public static var syncManager:SyncManager;          
                public static var session:Session;
                
                public static var PROD_CONFLICT_RESOLVED:String = "prodConflictResolved";
                public static var ORDER_CONFLICT_RESOLVED:String = "orderConflictResolved";
                public static var CUST_CONFLICT_RESOLVED:String = "custConflictResolved";
                public static var evtDisptchr:EventDispatcher = new EventDispatcher(); 
                
                public static function init():void
                {
                     /*
                     var logTarget:TraceTarget = new TraceTarget();
                     logTarget.level= LogEventLevel.ALL;
                     Log.addTarget(logTarget);
                     */
                     // Provide Credentials for Server side Connection and CFC
                     
                     
                     syncManager = new SyncManager();
                     
                     syncManager.autoCommit = true;
                     syncManager.cfPort = Port;
                     syncManager.cfServer = Server;
                     // Path of the Server side CFC having Sync/Fetch method, relative from CF webroot
                     syncManager.syncCFC = serverCFC;
                     //syncmanager.getRemoteObject().setRemoteCredentials("Jayesh","Jayesh");
                     // THis handler will be called when any COnflict occures while writing back changes on serverside 
                     syncManager.addEventListener(ConflictEvent.CONFLICT, conflictHandler);
                     
                     OpenLocalDBSession();
                     
                }