Location Info missing on 2nd computer- same log

Location Info missing on 2nd computer- same log

Postby diverduane » Fri Jul 20, 2018 6:55 am

So I just downloaded DiveLogDT and uploaded all my dives onto my laptop. The Log file is stored in a cloud drive, not a local drive. I amended the data with location information, equipment, notes etc. for some of the dives. I then went to download DiveLogDT onto my home computer - and opened the same SQL file. All the dives are there - but none of the location or equipment is there. Any clue? (It shouldn't matter - but laptop is MacBookPro and home is iMac)

Is that contextual info somehow stored locally and not in the .SQL file? And I have to use the synch feature? I stored the .SQL file in a shared drive for a reason - so I can use it from multiple computers. So I could avoid synch feature.

Thoughts?
diverduane
 
Posts: 2
Joined: Fri Jul 20, 2018 6:50 am

Re: Location Info missing on 2nd computer- same log

Postby support » Fri Jul 20, 2018 7:37 am

You have hit the nail on the head.

You need to work with the logbook file on a local drive (and use the sync feature to access it on other computers). This is because of the nature of databases (Sqlite in this case) and "cloud drives" (and is true of any Sqlite database file). The issue is that the database is running "transactions" on the database file and expects it to be 100% in control of the file while it is performing any updates to records (this is so that a transaction can be rolled back if necessary and so that transactions that need to impact multiple entries in the database happen in a single update). The catch is that "cloud drive" services use a combination of local copies of a file and remote copies of the file and they decide when they will "migrate" the file from the local drive to the servers in the cloud. If they happen to migrate the file in the middle of a transaction then the file that arrives in the cloud servers (and ultimately on the 2nd computer) will be in a unstable and incomplete state. The symptoms that you described are very common ones to see in this situation since "dives" in the database reference other tables to look to information like locations and equipment so if the dive was updated but not the location (or visa versa) before the file was transferred to the "cloud server" then you would see the behavior your describe.

Note that the problem is even worse in cases where you have the database open simultaneously on two computers. Unlike "network file systems" (like AFS or NFS), these cloud drives do not provide a mechanism for locking files between systems or even knowing that the file is open on another computer. Sqlite is expecting exclusive access to the database file so and makes no allowances for the fact that it can be updated by another program/system so it will certainly be corrupted in that case. The way that "cloud drives" (like iCloud Drive) deal with multiple systems accessing a file is by generating "conflict" version of the file when it sees two systems update a file "at the same time" (note that "at the same time" means when the file is uploaded to the server and not necessarily when you actually interact with it ... think about an iPhone that can't reach the internet for a period of time). DiveLogDT (and Dive Log on iOS's) sync facility ensures that the database file is in a stable state before it is transferred to/from the "cloud" and is aware of this conflict behavior and will resolve conflicts automatically during a sync (assuming the cloud service provides an interface to it's conflict files).

I hope that helps.

Cheers,

Greg
support
 
Posts: 571
Joined: Wed Mar 31, 2010 4:35 pm

Re: Location Info missing on 2nd computer- same log

Postby diverduane » Fri Jul 20, 2018 9:31 am

@Greg - THANK YOU. Yeah I'm an old database head and assumed that. However I was also assuming that 25+ years of development later we would have more tech to manage that process.

So last question - should I even use a "shared drive" in this case? Or just use a local copy and synch to cloud?
diverduane
 
Posts: 2
Joined: Fri Jul 20, 2018 6:50 am

Re: Location Info missing on 2nd computer- same log

Postby support » Fri Jul 20, 2018 10:25 am

You *could* use a shared drive (and for anyone else reading this, that means a single physical drive that is accessible from two computers via the network and not a "cloud drive" service like Dropbox, iCloud Drive, Google Drive, etc.) *BUT* you would need to make sure that you don't have two copies of DiveLogDT with the the database file open at the same time.

The database engine that DiveLogDT is using is Sqlite3. This is a very simple, in core database engine that does not even support threading let alone multiple process access. So any potential for shared access is risky but with a shared drive you at least don't have some background process reading the database file behind your back as the case with cloud drive services.

I would recommend for most users that they use the sync functions or, if like, you can simply copy the underlying logbook file from one device to another (this is fine through cloud services, USB drives or shared file systems) but make sure close DiveLogDT before copying the file. The advantage of using the sync function is that you can make changes on multiple devices and then have them all aggregated via the sync function at a later time (changes are managed at a database record level, so latest update to any particular record will be the "winner" so making two changes to the same dive record on two devices will result in the complete record of the most recent change being the result but you can edit two different dives and both those edits will end up in the final result).

Sorry for all the extra detail, but hopefully that gives you the background you need to make the best choice for your situation. Don't hesitate to reach out again of you have additional questions.

Cheers,

Greg
support
 
Posts: 571
Joined: Wed Mar 31, 2010 4:35 pm


Return to DiveLogDT/Dive Log Manager

Who is online

Users browsing this forum: No registered users and 2 guests