[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coldsync-hackers] Deleting records from a conduit
- To: <coldsync-hackers at lusars dot net>
- Subject: [coldsync-hackers] Deleting records from a conduit
- From: "Marco van Beek" <marco at 84andahalf dot com>
- Date: Sat, 26 Jul 2003 23:03:55 +0100
- Organization: 84½ Archway Rd
- Reply-to: coldsync-hackers at lusars dot net
- Sender: owner-coldsync-hackers at lusars dot net
Hi All,
I have been writing a bi-directional conduit to synchronise with a MySQL
database and have come across some strange behaviour.
Both the fetch and the dump conduit seem to work perfectly well on their
own. I am matching the Palm record ID (which seems to change every time you
edit a record on the palm) with the MySQL ID field, and mostly it all works
well.
However, when both are working together (as a fetch,dump conduit), I get
some strange interaction. What seems to happen is that if a record is
deleted on the Palm Pilot, the sync ignores this deletion and forces a "new"
record to be written. This also happens with edited records which get a new
ID as part of the editing process.
The "desktop" always seems to win, and the only time the Palm can delete
records (or properly save the edits back) is when the fetch does not happen
first.
It would seem to me that the problem is created during the generic sync. I
think that non-dirty records are resetting the deleted flag rather than
leaving it alone. Is this how it should work, or have I got something wrong
somewhere? I am using the "{_seen}" flag to clear out records that no longer
exist. Perhaps this is the problem. I have thought that perhaps I should use
a
deleted flag in the MySQL database rather than a delete, and then if I get a
match I could set the deleted flag instead of having to use the {_seen} flag
which could be causing the generic sync to overwrite the deleted flag on the
Palm pilot.
I am open to any theories !
I have also found two references as to reading the deleted record flag, one
being "$record->{attributes}{deleted}" and the other "$record->{deleted}".
From the documentation it would appear that the first is correct. If so,
then the deleted flag would appear no longer set when the dump conduit runs.
For those of you interested in what I am trying to do, please have a look at
http://ssis.sourceforge.net/.
Thanks for any help,
Regards,
Marco van Beek
Supporting Role Ltd
--
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.