Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Online/offline database sync in Flash Builder

Posted on 2011-09-23
12
Medium Priority
?
1,282 Views
Last Modified: 2012-06-27
I am working on an AIR app which should work in both online and offline model (client side on Ipads). The user can do various actions, while offline and the results would get saved in a local DB. The same needs to get synced up with a MySql DB once the user goes online using PHP.

I am programming the UI in Flash builder (flex). The web database is written for Php/Mysql/Apache

I am looking for some tutorials / demos / how-to on the subject.

Thanks
0
Comment
Question by:hugooguh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 24

Expert Comment

by:johanntagle
ID: 36591243
Some ideas are described at http://forums.adobe.com/message/943813 but I think http://www.adobe.com/devnet/coldfusion/articles/offline_air_orm.html isthe starting point you are looking for.
0
 

Author Comment

by:hugooguh
ID: 36712398
Thanks but I am looking for a solution in a Air/PHP/MySql environment.
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36713612
I am using AIR local SQLLIte DB
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:hugooguh
ID: 36716652
How can you sync up the local SQLLite database with a distant MySql DB once the user goes online ?
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36718858
In AIR we have network monitoring API you can add listener and as soon as you will detect connection upload your file into server or create dump DB script
0
 

Author Comment

by:hugooguh
ID: 36972035
I've requested that this question be deleted for the following reason:

No solution found
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36965699
Why do you want to close this question without explanation what is not working for you?
0
 

Author Comment

by:hugooguh
ID: 36970799
Well, I still don’t know what is the best script/procedure/best practice to synchronize an Ipad/SQLLite to a distant Linux/MYSQL database. How does the Ipad application knows what is the newest data to Insert/update on both databases.

Maybe I’m not clear enough. I know my English is not optimal.

Thanks anyway
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 36972036
hugooguh:
So you want to get logic how to handle changes from the tables on related to the database.
The common strategy to create an extra field as datatimestamp or versionId and when user submitting a value check his current record timestamp with version from a DB . If timestamp or versionId are diffrent bring popup dialog and inform an user
0
 

Author Comment

by:hugooguh
ID: 36979401
Great! Thanks for the info. But what about the data updated by other users in the distant database. How can we refresh the local database efficiently (ie without importing all the data or comparing all the timestamps every time a user gets online?)
0
 
LVL 29

Assisted Solution

by:dgofman
dgofman earned 2000 total points
ID: 36981055
The same logic what I describe before. If you are keeping an extra column (dateModified) as timestamp you have to make get all new records from DB by timestamp
SELECT * FROM TABLE WHERE DATE_MODIFIED > flexTimeStamp;
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36996974
So, you can accept #36981055 and #36972036
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question