is there a simple way to find out in the client database if a row was sent to the server by MobiLink?
One option would be to add a column that's set on the server and sent back to client. However this would leaves a gap of a couple of seconds between sending and receiving the data.
The background is that the data is synchronized from the server to another system and some values can't be changed any more after the synchronization with the 3rd party server took place
Another option would be setting a flag manually on the client that the data is ready to be sent to the 3rd party server. This has the drawback that the user has to think to set the *ready flag".
Any suggestions are welcome
asked 24 Sep '14, 00:14
Assumption: This entire discussion applies to a SQL Anywhere remote database, NOT the consolidated database.
If the row on the remote database had a TIMESTAMP DEFAULT TIMESTAMP column that was not used for anything else (and presumably not included in the upload since that would violate the "not used for anything else" clause), then that column could be checked against the timestamp for the last successful upload for the publication that uploads this table. I think "the timestamp for the last successful upload" is to be found in SYSSYNC.last_upload_time column.
IF table.last_updated < SYSSYNC.last_upload_time THEN the-row-has-been-sent-to-the-server;
Can the row be updated on the remote after the earlier version is uploaded but before SYSSYNC.last_upload_time is set? ...the answer to that question may determine whether this suggestion will work, or can be made to work, or is just a load of hooey :)
-- SYS.ISYSSYNC (table_id 46) in SQL Anywhere 16 Demo - autostart and connect - Sep 24 2014 8:50:39AM - Print - Foxhound © 2014 RisingRoad CREATE TABLE SYS.ISYSSYNC ( -- empty sync_id /* PK */ UNSIGNED INT NOT NULL, type /* X */ CHAR ( 1 ) NOT NULL, publication_id /* FK U */ UNSIGNED INT NULL, progress UNSIGNED BIGINT NULL, site_name /* U X */ CHAR ( 128 ) NULL, "option" LONG VARCHAR NULL, server_connect LONG VARCHAR NULL, server_conn_type LONG VARCHAR NULL, last_download_time TIMESTAMP NULL, last_upload_time TIMESTAMP NOT NULL DEFAULT 'jan-1-1900', created UNSIGNED BIGINT NULL, log_sent UNSIGNED BIGINT NULL, generation_number INTEGER NOT NULL DEFAULT 0, extended_state VARCHAR ( 1024 ) NOT NULL DEFAULT '', script_version CHAR ( 128 ) NULL, subscription_name /* U */ CHAR ( 128 ) NULL, server_protocol UNSIGNED BIGINT NULL, CONSTRAINT PRIMARY KEY ( sync_id ) ); -- Parents of SYS.ISYSSYNC -- SYS.ISYSPUBLICATION -- Children -- none -- ALTER TABLE SYS.ISYSSYNC ADD CONSTRAINT ISYSPUBLICATION FOREIGN KEY ( publication_id ) REFERENCES SYS.ISYSPUBLICATION ( publication_id ) ON UPDATE RESTRICT ON DELETE RESTRICT; CREATE UNIQUE INDEX pub_site ON SYS.ISYSSYNC ( publication_id, site_name ); CREATE UNIQUE INDEX subscription_name ON SYS.ISYSSYNC ( subscription_name ); CREATE INDEX sync_site_name ON SYS.ISYSSYNC ( site_name ); CREATE INDEX sync_type ON SYS.ISYSSYNC ( type );
answered 24 Sep '14, 09:02