Working example of QC DBSync

35 views
Skip to first unread message

Matic

unread,
Dec 29, 2011, 1:30:40 PM12/29/11
to QuickConnect
Hello,

where can I get working example of QC DBSync for MySQL database and
iOS application. The included example is not working for me. Where can
I get MySQL database for this example (game, person,...).

I do not know how to start. I would appreciate working example :)

Thanks in advance,

Matic

Matic

unread,
Jan 21, 2012, 3:30:01 AM1/21/12
to QuickConnect
OK. I have successfully connected iPad and server. I have a large
database on server (with 15 tables) and would like to sync them to
iPad. What is the best way to do this? Do I have to write SQL
statements for every table or is there another way? For example, on
iPad all entites inherit from trackable. Do I also create trackable
table on server? What is the best way to do syncing? How do I update
relationships on iPad? Please help!

lee barney

unread,
Jan 21, 2012, 3:56:55 AM1/21/12
to quickconn...@googlegroups.com
Matic,

I'm assuming that you have created the data objects that inherit from Trackable in your app.

Each time you call the sync method, see the API, in your application all of the changes, creations, and deletions for these objects will be sent to the server as a JSON string. Included in that string will be a series of messages containing all of the changes made on the device.

Each of these messages will contain information regarding one single change. You can then choose to handle the change on the server side in any fashion you wish. You do not need a trackable table on the server.

Once your server code has handled the changes from the device it should reply to the request with any changes that need to be pushed to that specific device. These take the same format as the JSON message just received and handled.

If you go to http://www.quickconnectfamily.org/iOSDevCon you will find a file called presentations.zip. In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt. Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent. Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description. If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.

You will also find a file called entSync.zip which contains source code that I produced for the client and server side. It was working when I zipped it up but I haven't run the code since I presented at the developer conference.

Lee

> --
> You received this message because you are subscribed to the Google Groups "QuickConnect" group.
> To post to this group, send email to quickconn...@googlegroups.com.
> To unsubscribe from this group, send email to quickconnectiPh...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/quickconnectiPhone?hl=en.
>

Matic

unread,
Jan 21, 2012, 9:59:23 AM1/21/12
to QuickConnect
Hello,

I dowloaded examples and they are working. But they look outdated. Now
I am trying to make working example from new sources. I can sync data
from iPad to table updates (raw json) but then when I want to sync the
same data on an empty iPad sync fails with index out of bounds error.

This is JSON iPad receives from server:

{"sync_time":"2012-01-21 14:49:04","sync_data":
[{"sync_type_GameResult":
{"gameName":"Game","eventType":"create","UUID":"26642CB8-53E4-4299-
A183-A2CD3483BD32","score":1234,"updateTime":"2012-01-21
15:44:11","player":{"sync_type_Person":
{"eventType":"create","UUID":"2C9B63A3-5304-4792-8DA2-0ACB5C86344F","name":"Test","updateTime":"2012-01-21
15:44:11","games":[{"UUID":"26642CB8-53E4-4299-A183-
A2CD3483BD32"}]}}}}]}

GameResults is ok. Player fails (index out of bounds).

Do you have any idea?

Thanks!

Matic

On 21 jan., 09:56, lee barney <barney....@gmail.com> wrote:
> Matic,
>
> I'm assuming that you have created the data objects that inherit from Trackable in your app.
>
> Each time you call the sync method, see the API, in your application all of the changes, creations, and deletions for these objects will be sent to the server as a JSON string.  Included in that string will be a series of messages containing all of the changes made on the device.
>
> Each of these messages will contain information regarding one single change.  You can then choose to handle the change on the server side in any fashion you wish.  You do not need a trackable table on the server.
>
> Once your server code has handled the changes from the device it should reply to the request with any changes that need to be pushed to that specific device.  These take the same format as the JSON message just received and handled.
>
> If you go tohttp://www.quickconnectfamily.org/iOSDevConyou will find a file called presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.

Barney Cit

unread,
Jan 21, 2012, 12:20:07 PM1/21/12
to quickconn...@googlegroups.com
Could you post the error message as it is displayed?

Sent from my iPad

Matic

unread,
Jan 21, 2012, 12:24:01 PM1/21/12
to QuickConnect
Sure:

2012-01-21 18:23:35.272 QC DBSync Example[13582:fb03]



beginning of loopData 0 from server: {
"sync_type_GameResult" = {
UUID = "26642CB8-53E4-4299-A183-A2CD3483BD32";
eventType = create;
gameName = Neki;
player = {
"sync_type_Person" = {
UUID = "2C9B63A3-5304-4792-8DA2-0ACB5C86344F";
eventType = create;
games = (
{
UUID = "26642CB8-53E4-4299-A183-A2CD3483BD32";
}
);
name = Test;
updateTime = "2012-01-21 15:44:11";
};
};
score = 1234;
updateTime = "2012-01-21 15:44:11";
};
}
2012-01-21 18:23:35.273 QC DBSync Example[13582:fb03]



Starting new object from dictionary.
2012-01-21 18:23:35.273 QC DBSync Example[13582:fb03] type:
sync_type_GameResult description: {
UUID = "26642CB8-53E4-4299-A183-A2CD3483BD32";
eventType = create;
gameName = Neki;
player = {
"sync_type_Person" = {
UUID = "2C9B63A3-5304-4792-8DA2-0ACB5C86344F";
eventType = create;
games = (
{
UUID = "26642CB8-53E4-4299-A183-A2CD3483BD32";
}
);
name = Test;
updateTime = "2012-01-21 15:44:11";
};
};
score = 1234;
updateTime = "2012-01-21 15:44:11";
}
2012-01-21 18:23:35.274 QC DBSync Example[13582:fb03] working with a
GameResult
2012-01-21 18:23:35.275 QC DBSync
Example[13582:fb03] !!!!!!!!!!!!!!!!!!!!!!creating!!!!!!!!!!!!!!!!
2012-01-21 18:23:35.275 QC DBSync Example[13582:fb03] setting
attribute: gameName with value: Neki
2012-01-21 18:23:35.276 QC DBSync Example[13582:fb03] setting
attribute: UUID with value: 26642CB8-53E4-4299-A183-A2CD3483BD32
2012-01-21 18:23:35.276 QC DBSync Example[13582:fb03] setting
attribute: score with value: 1234
2012-01-21 18:23:35.277 QC DBSync Example[13582:fb03] setting
attribute: updateTime with value: 2012-01-21 15:44:11
2012-01-21 18:23:35.278 QC DBSync Example[13582:fb03]



Starting new object from dictionary.
2012-01-21 18:23:35.278 QC DBSync Example[13582:fb03] type:
sync_type_Person description: {
UUID = "2C9B63A3-5304-4792-8DA2-0ACB5C86344F";
eventType = create;
games = (
{
UUID = "26642CB8-53E4-4299-A183-A2CD3483BD32";
}
);
name = Test;
updateTime = "2012-01-21 15:44:11";
}
2012-01-21 18:23:35.278 QC DBSync Example[13582:fb03] working with a
Person
2012-01-21 18:23:35.279 QC DBSync
Example[13582:fb03] !!!!!!!!!!!!!!!!!!!!!!creating!!!!!!!!!!!!!!!!
2012-01-21 18:23:35.280 QC DBSync Example[13582:fb03] setting
attribute: UUID with value: 2C9B63A3-5304-4792-8DA2-0ACB5C86344F
2012-01-21 18:23:35.280 QC DBSync Example[13582:fb03] setting
attribute: name with value: Test
2012-01-21 18:23:35.281 QC DBSync Example[13582:fb03] setting
attribute: updateTime with value: 2012-01-21 15:44:11
2012-01-21 18:23:35.374 QC DBSync Example[13582:fb03] failed: Error
Domain=org.quickconnectfamily.qcsync Code=1 "*** -[__NSArrayI
objectAtIndex:]: index 2 beyond bounds [0 .. 0]" UserInfo=0x6ba89f0
{NSFilePath=sync:, NSUnderlyingError=0x6ba8970 "The operation couldn’t
be completed. Invalid argument", NSLocalizedDescription=*** -
[__NSArrayI objectAtIndex:]: index 2 beyond bounds [0 .. 0]}
2012-01-21 18:23:35.376 QC DBSync Example[13582:fb03] deleting
<NSManagedObject: 0x6ba7a10> (entity: Person; id: 0x6ba7a70 <x-
coredata:///Person/t55F54B26-4DFC-45A0-BEB5-00991FCB15B94> ; data: {
UUID = nil;
eventType = nil;
flaggedAsDeleted = nil;
games = (
);
isRemoteData = nil;
name = nil;
updateTime = nil;
})
2012-01-21 18:23:35.376 QC DBSync Example[13582:fb03] deleting
<NSManagedObject: 0xcf797c0> (entity: GameResult; id: 0xcf79820 <x-
coredata:///GameResult/t55F54B26-4DFC-45A0-BEB5-00991FCB15B93> ; data:
{
UUID = nil;
eventType = nil;
flaggedAsDeleted = nil;
gameName = nil;
isRemoteData = nil;
player = nil;
score = 0;
updateTime = nil;
})
2012-01-21 18:23:35.377 QC DBSync Example[13582:fb03] deleting
<NSManagedObject: 0x6d8e680> (entity: SyncTracker; id: 0x6d8e6d0 <x-
coredata:///SyncTracker/t55F54B26-4DFC-45A0-BEB5-00991FCB15B92> ;
data: {
lastSync = nil;
})

On 21 jan., 18:20, Barney Cit <barney....@gmail.com> wrote:
> Could you post the error message as it is displayed?
>
> Sent from my iPad
>
> >> If you go tohttp://www.quickconnectfamily.org/iOSDevConyouwill find a file called presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.

Matic

unread,
Jan 21, 2012, 2:03:44 PM1/21/12
to QuickConnect
It looks like QCSync wants to access a Game object which does not
exist in the database yet.
I have another question: How do I "send" relationships to iPad?
Because core data objects have NSSet or pointers to other objects so
this has to be created on insertion. Do I have to create entitites
first and then create relationships or is that done automaticaly?
> > >> If you go tohttp://www.quickconnectfamily.org/iOSDevConyouwillfind a file called presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.

Matic

unread,
Jan 22, 2012, 6:39:50 AM1/22/12
to QuickConnect
What is the difference between version from 2010 and latest version?
Performance, stability? Because I am seriously considering using
version from 2010 because I have working example.
> > > >> If you go tohttp://www.quickconnectfamily.org/iOSDevConyouwillfinda file called presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.
>
> > > >> You will also find a file called entSync.zip which contains source code that I produced for the client and server side.  It was working when I zipped it up but I haven't run the code since I presented at the developer conference.
>
> > > >> Lee
>
> > > >> On Jan 21, 2012, at 1:30 AM, Matic wrote:
>
> > > >>> OK. I have successfully connected iPad and server. I have a large
> > > >>> database on server (with 15 tables) and would like to sync them to
> > > >>> iPad. What is the best way to do this? Do I have to write SQL
> > > >>> statements for every table or is there another way? For example, on
> > > >>> iPad all entites inherit from trackable. Do I also create trackable
> > > >>> table on server? What is the best way to do syncing? How do I update
> > > >>> relationships on iPad? Please help!
>
> > > >>> On 29 dec. 2011, 19:30, Matic <i...@makroplus.si> wrote:
> > > >>>> Hello,
>
> > > >>>> where can I get working example of QC DBSync for MySQL database and
> > > >>>> iOS application. The included example is not working for me. Where can
> > > >>>> I get MySQL database for this example (game, person,...).
>
> > > >>>> I do not know how to start. I would appreciate working example :)
>
> > > >>>> Thanks in advance,
>
> > > >>>> Matic
>
> > > >>> --
> > > >>> You received this message because you are subscribed to the Google Groups "QuickConnect" group.
> > > >>> To post to this group, send email to quickconn...@googlegroups.com.
> > > >>> To unsubscribe from this group, send email to
>
> ...
>
> preberite več »

Matic

unread,
Jan 23, 2012, 9:05:25 AM1/23/12
to QuickConnect
Syncing library is completely unusable without examples! It is not
possible to create correct jsons. I am working on syncing part for
days now without results. What are my other options? Libraries?
> > > > >> If you go tohttp://www.quickconnectfamily.org/iOSDevConyouwillfindafile called presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.
>
> > > > >> You will also find a file called entSync.zip which contains source code that I produced for the client and server side.  It was working when I zipped it up but I haven't run the code since I presented at the developer conference.
>
> > > > >> Lee
>
> > > > >> On Jan 21, 2012, at 1:30 AM, Matic wrote:
>
> > > > >>> OK. I have successfully connected iPad and server. I have a large
> > > > >>> database on server (with 15 tables) and would like to sync them to
> > > > >>> iPad. What is the best way to do this? Do I have to write SQL
> > > > >>> statements for every table or is there another way? For example, on
> > > > >>> iPad all entites inherit from trackable. Do I also create trackable
> > > > >>> table on server? What is the best way to do syncing? How do I update
> > > > >>> relationships on iPad? Please help!
>
> > > > >>> On 29 dec. 2011, 19:30, Matic <i...@makroplus.si> wrote:
> > > > >>>> Hello,
>
> > > > >>>> where can I get working example
>
> ...
>
> preberite več »

Matic

unread,
Jan 27, 2012, 12:51:05 PM1/27/12
to QuickConnect
This thing does not work. NSPredicate is not filtering data correctly
so whole syncing is wrong. See here
http://stackoverflow.com/questions/7129157/nspredicate-is-not-filtering-the-results-of-a-fetch-request
So this library is useless!
> > > > > >> If you go tohttp://www.quickconnectfamily.org/iOSDevConyouwillfindafilecalled presentations.zip.  In that zip file you will find a presentation on using the synchronization libraries, Enterprise_Sync.ppt.  Included in this presentation you will find a slide containing the format of the JSON messages that the device will send and that the device expects. Each change for each object is sent.  Included in each message regarding each change is the full description of the object at that time. This is shown on the slide as the key-value description.  If you make changes using your app and then call sync you should be able to print out what the messages are for the objects you are using in your app.
>
> > > > > >> You will also find a file called entSync.zip which contains source code that I produced for the client and server side.  It was working when I zipped it up but I haven't run the code since I presented at the developer conference.
>
> > > > > >> Lee
>
> > > > > >> On Jan 21, 2012, at 1:30 AM, Matic wrote:
>
> > > > > >>> OK. I have successfully connected iPad and server. I have a
>
> ...
>
> preberite več »
Reply all
Reply to author
Forward
0 new messages