Active Sync Database Adapter
Howdy,
I have a quick question about using Active Sync with a database table. Do you have to use predicates to get back the changed rows? Or will the Active Sync adapter be able to tell which rows have been updated without needed to use a modified date predicate (or something similar)?
Thanks!
[313 byte] By [
JimBeard] at [2007-11-26 9:20:31]

# 3
Okay, I'll bite.Yes, the adapter needs to do a query that selects only new or modified records. Or it can do a query to get new records from a changelog, which has the advantage of being able to detect deletes.
# 4
So I do need to use a predicate to determine which entries need to be picked up by active sync. Thanks, that helps ;)
Could you expand on the changelog however? Changelog is an ambigious term, so I'm not sure exactly what you are referencing there. Do you just mean a collection of 'change events' as opposed to querying the individual records themselves?
We currently have a database table that holds only change values, so it sounds like we should be able to load that table as a resource, and use active sync to pull the data from it.
Thanks for the response! I appreciate it.
# 5
There are a few ways you can do this.
A common way is to have database triggers on the table containing account information. When a row is added, modified, or deleted, the trigger writes a change record into a changelog table. The change record contains the type of change (add/mod/del), the name of the account that was modified, the name of the modifier, and a sequence number.
The resource adapter polls the changelog looking for new rows with a sequence number greater than it saw in the previous poll. It filters out changes made by itself, in the case where the adapter is bi-directional. It processes the remaining records. For add and modify changes, it will need to search in the account info table to get the information it needs. For deletes, it probably doesn't need anything more than the name of the account that was deleted.