Just for the record I have MotorolaRhoMobileSuite18.104.22.168 installed (not 22.214.171.124211162257 which is shown by Help->About and is incorrect).
Please be aware of a setting that may be the cause of not sync'ing after the initial sync. The poll_interval default value is set to 5 minutes (300 seconds). That means this value must elapse before sync'ing again. You can decrease this value or disable it entirely by replacing the value to 0. This setting can be found in the setting.yml file within your rhoconnect app.
I have modified poll_interval to 0 and this does not resolve the issue.
Please note that when I do a manual sync by clicking on the "Sync" button on my simulator the MySql local DB changes are refreshed on my simulator.
However, if I created any new products on the simulator they are lost (i.e NOT synced to the DB).
If I use the MySQL utility to create a new product row in the DB then when I "Sync" on the simulator the new product row appears in the simulator correctly.
So in summary, if I create a new product on the client simulator screen then they are not saved to the DB are are lost when I click on "sync".
When you say "create any new products on the simulator they are lost" do they show at all in your app's UI? Can you create products with your client app?
If you can create and see new records and then the sync doesn't push new records to the back-end DB, then it sounds as the create method from your source adopter isn't doing it's job. Is your source adaptor referencing DB attribute names? if so, check that they're correct.
Also. I would suggest checking and ensuring the Product model name from your RhoElements app is identical (case sensative) to the name of the source adaptor of your RhoConnect app.
Any new products created on the simulator do indeed show up on the app's UI correctly.
However, they are "lost" (or disappear) from the app's UI only AFTER I press the "sync" button on the app's UI.
That is, after the "sync" button is pressed the data from the local DB is refreshed on the app's UI (i.e the new rows created on the app's UI are NOT saved to the local MySQL DB).
Thanks for pointing out the case sensitivity of the "product model name". This was one of my initial problems.
Nowhere in the project can I see the plural form used ?
I only see "product" or "Product"
Is the backend app based on Rails or .NET? If Rails then the http://localhost:3000/products probably comes from the schema file, specfically in the "schema.rb" file located in the "db" folder of your rails app.
The problem I see here is the mix of two sync methods - Source adopter and Push. Although coexistance is feasable, i find it could be redundant in some instances, which may reequires some fine tunning. If you have RhoConnect Push working you'll see that create/update/delete transactions do get sync'd regardless where they're initiated. In other words, with your setup from webinar of Dec 12 you could sync bi-directional including addition records from the client. That said, not only can you auto sync records updates from the back-end system you can also sync change initiated by a manual sync from the device.
Note, in order for Push to work you'll need to run your app from a device with the push notification services installed and running.
> Is the backend app based on Rails or .NET?
Remember my project code is based on the webinar example code (as per "Dec 12, 2012 - RhoConnect Push").
Therefore from my limited understanding (I'm a newbie) the backend app is based on Rails.
Peter your suggestion to look at schema.rb has put me on the correct track to debug and SOLVE the issue :
What I discovered was that I had a syntax error in SQL Insert statement (within the source adapter).
The rhoconnect error log showed "SourceAdapter raised create exception: Too many SQL parameters".
My incorrect SQL that caused this error was 'INSERT into products (name, brand, price, quantity, sku) VALUES (?,?)'
The correct SQL should be 'INSERT into products (name, brand, price, quantity, sku) VALUES (?,?,?,?,?)'
After fixing this everything now works correctly and I successfully have RhoConnect Push working via a MySQL source adapter.
Thank you very much for taking the time to assist in resolving this problem !!
Did you set the `:push_notify:` field in your settings.yml as described in the webinar? Otherwise no automatic pushes will be sent.
I can clarify that ":push-notify: true" is set in settings.yml
I have now also now set ":poll_interval: 0" in settings.yml
Please also note the following:
1. I do not have any issues getting webinar "Dec 12, 2012 - RhoConnect Push" to work correctly.
2. I do not have any issues getting webinar "Oct 17, 2012 - Direct Database Connectivity Using RhoConnect" to work correctly.
Therefore it would be safe to assume the required settings are set correctly as per the webinar instructions for each individual webinar project.
The issue is observed after I modify the "Dec 12, 2012 - RhoConnect Push" code to use a source adapter and connect to a
local MySQL DB (instead of using the default SQLlite DB that is otherwise displayed via http://localhost:3000/products/)
So I know the source adapter is working (because the MySQL DB data is displayed not the SQLlite data).
Only Issue is "new data created on the client is not synced back to the MySQL DB".