NetTalk Central

Author Topic: Server and Client Disconnect ts and sts problem with Date+time Clock  (Read 3942 times)

KC Chin

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
C11 ABC, NTApp ver11.31

After debugging for past 3 days.
Finally....

A. Server disconnect, the Server's computer clock

B. Local LAN PC clock (App.exe access the "A" server database)
Both A and B on same LAN

C. Client disconnect, the Local PC clock (from different department)

Both A and B clock is off by 3 minutes.
Example:
A=10:33:00am and B=10:30:10am C=10:32:50am

When "B" insert a new record to the server database, the ts and sts stored 10:30:10am

When "C", start to Sync with the "A" Server, the Server Log "everythingafter" show example 158579xxx like 10:33:00am.

The "C", cannot fetch any record that "B" had inserted at 10:30:10am

After changed the "B" computer to clock to match the "A" clock, everything work out, ok.

If I don't change the "B" PC clock, and do "Force Fetch All Data" or "Force Send All Data", every records will synchronize because, "C" will send "everythingafter" = -1

Is there a way to prevent the situation where ts, sts, and dts date+time is behind the server clock?

Regards,

KC Chin

KC Chin

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Server and Client Disconnect ts and sts problem with Date+time Clock
« Reply #1 on: April 02, 2020, 03:51:41 PM »
additional notes

1. Using Firebird SQL 3
2. further investigation regarding the timestamp, the ts and sts
- netSync.clw
- the NetWebSyncClient.GetMaxStsSQL is using Select Max

if any computer/PC clock that its "date+time" is less that the max when Insert records to the server, the ClientDisconnect Sync will not fetch those records.

Only "Force Fetch All Data" where the "everythingafter=-1" can get those record inserts.

Is there any other method to prevent the "sts" different especially the PC clock is not synchronize with the Internet Time?
Why? because not all computer is have the access to internet.
Why again? too many idiot cannot see the very large font date and time that display on the monitor when they login.

Regards,
KC Chin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Server and Client Disconnect ts and sts problem with Date+time Clock
« Reply #2 on: April 06, 2020, 01:07:21 AM »
Hi KC,

the root of the problem seems to be the time floating on machines not connected to the internet.
But presumably they can connect to the server to do a Sync. So you may want to add an API to the SyncClient to get the current data and time.
This won't help with "old records with the wrong time" but presumably this'll happen often enough so that the client and server stay reasonably in sync.

It would be possible of course to build a "window" into the sync request, but if the clients are floating the window will never be big enough...

Cheers
Bruce


KC Chin

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Server and Client Disconnect ts and sts problem with Date+time Clock
« Reply #3 on: April 06, 2020, 05:27:41 AM »
Bruce,

How about sync based on the "everythingafter" = certain date+time, instead of -1 (Force ...All data)?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Server and Client Disconnect ts and sts problem with Date+time Clock
« Reply #4 on: April 06, 2020, 08:20:54 PM »
sure you can do that, but the amount of data transferred would go up a _lot_.
Remember the sync happens often - maybe every minute or so. So basically you'd continually be getting the same data over and over again. For every table. This would add up a _lot_.

Keeping the machines in reasonable time sync is a much better approach.

cheers
Bruce