Lock to prevent multiple access

bernard's Avatar

bernard

08 Apr, 2018 10:11 AM

Hello,

I'm synching Moneydance with folder and access it with either of 2 computers.
Also I take care that money dance is closed and synced on one computer before opening on the second computer, error can happen.
I want to avoid mismatch in my data and I'm afraid it could occur if I open 2 instances of money dance on 2 separate computers.

Would you consider setting up a lock file when moneydance opens a sync folder and deleting it after syncing data back to the folder?

Could you then before opening a sync folder check if a lock file exists and prevent opening moneydance if the lock file exists.

Thanks,

Bernard

  1. 1 Posted by dwg on 08 Apr, 2018 10:40 AM

    dwg's Avatar

    I'm a fellow customer.

    Moneydance 2017 includes its own syncing engine, this allows multiple instances of Moneydance on multiple machines to pass transaction data between themselves and thus keep a local copy of the data up-to-date.

    There is no longer any need to place the Moneydance data on a shared location and in general it is not recommend to place the Moneydance data set in a share location in any case with Moneydance 2017 as the way data is read/written in this version can be a problem with some share services.

    So while some sort of locking mechanism would be desirable in earlier versions of the software, and what you have describes is a simple mechanism used with some Unix systems, it would not seem to be warranted with Moneydance 2017.

  2. 2 Posted by derekkent23 on 08 Apr, 2018 11:03 AM

    derekkent23's Avatar

    I am not support staff, just a user.

    To add to dwg comments.

    To set up syncing using 2017 own syncing engine see http://help.infinitekind.com/kb/syncing-and-sharing-data

    You don't state which build of 2017 you are running on your computer but you should ensure your are running the latest build as there have been a number of bug fixes some relating to syncing see https://infinitekind.com/download-moneydance-personal-finance-software

    Hope this helps

  3. 3 Posted by bernard on 14 Apr, 2018 08:41 AM

    bernard's Avatar

    Hello,

    I'm using the latest 2017.7.1 (1671).

    I have setup Folder Sync between computer A and computer B.

    Also I don't see option "Dropbox Folder" under sync menu, the folders are indeed Dropbox folders.

    Seems I was not clear enough because nobody seem to have pictured what I meant.

    1) my understanding of good practice:

    • open computer A,
    • open & work on moneydance
    • close moneydance
    • wait for the Sync Folder being synced (files sent to cloud)
    • open computer B
    • wait for the Sync Folder being synched (files downloaded from cloud)
    • open & work on moneydance
    • close moneydance
    • etc

    This I know and works pretty well. Thanks

    2) my question is about issue of the following and avoid impact

    2.a) what if

    • open computer A,
    • open & work on moneydance
    • DO NOT close moneydance on computer A
    • OR DO NOT wait for the Sync Folder being synced (files sent to cloud)
    • open computer B
    • DO NOT wait for the Sync Folder being synched (files downloaded from cloud)
    • open & work on moneydance on computer B

    I would therefore expect file conflicts at later sync time, presumably having a corrupt moneydance synced folder

    I did try and have had files conflicts

    CORRECT ? Anything I'm missing?

    2.b) how to prevent?

    Obviously, does as explained in (1) above.

    But sometimes, you just don't sit beside computer A and B at the same time and have no idea whether computer A has moneydance closed and data synced.

    The original question/suggestion (to the moneydance developper) is:

    Could you
    * create a lock file in the sync folder when opening moneydance * check existence of this lock file before allowing the opening of moneydance

    Purpose: prevent 2.a

    Hope this is more clear what I mean.

    Bernard

  4. 4 Posted by derekkent23 on 14 Apr, 2018 09:45 AM

    derekkent23's Avatar

    I am not support staff, just a user.

    As far as I know, if you have a Dropbox Account and you can see your Dropbox folder on your C drive then the only reason Dropbox Folder would not be an option is if your computers are Mac and you did not purchase direct, but from Apply. Is this the case?

    Do you have the syncing option Dropbox Connection?

    Provided you do not move your data sets from there default location on your hard drive and use the Moneydance internal syncing engine you should have no problems.

    The purpose of the syncing engine is to allow you to have two computers running Moneydance at the same time. Enter a transaction on one computer and watch it appear on the other computer usually within 30 second.

    Perhaps an overview of the internal syncing would help.

    You have a number of options regarding the syncing method. The syncing method “Shared Folder” is not discussed here but its approach is similar to Dropbox folder. The other two syncing methods need a Dropbox Account,

    However, if you did not purchase direct, but purchased through Apple, due to one of the restrictions Apply impose on Moneydance, you will have to use “Dropbox Connect” in the following steps. Dropbox Folder is more flexible. For example, with Dropbox Connection if you lose your internet connection when running Moneydance you could lose data. With Dropbox Connect a API in Moneydance talks direct to your Dropbox file in the cloud. Whereas with Dropbox Folder Moneydance talks to the local Dropbox folder on your hard drive. Then syncs to your cloud Dropbox folder when the internet is available.

    The following is an explanation given by Sean the software developer regarding these two syncing methods, Dropbox Folder and Dropbox Connection.

    “With "Dropbox Connection" Moneydance uses the Dropbox API to talk to the Dropbox service directly. So, you don't need to have Dropbox client actually installed on your computer, but you do need to be online when Moneydance is running in order for changes to be synced. With "Drobox Folder" Moneydance will just read and write files to your Dropbox folder on your computer, which means that you need to have Dropbox client installed and running, but you don't need to be online in order for Moneydance to read and write the changes.”

    When syncing with 2017 you have a primary and a secondary computer. The data set is stored in the default location on the hard drive of your primary computer. See under HELP – SHOW DOCUMENT FOLDER. Your data set is a folder not a file. It contains other folders and files. The data set folder is named yourdatasetname.moneydance. In later builds of 2017 you are prompted to allow Moneydance to automatically move your data set to the default location if Moneydance detects you have your data set in Dropbox. If you don’t allow your data to be moved it may become corrupted! DON’T STORE YOUR DATA SET IN DROPBOX or any other shared drive.

    Your second computer does not have the same data set as the primary computer. Its data set is created from data synced via Dropbox folder “.moneydancsync” created automatically by the primary computer. The folder “.moneydancesync” may be hidden, so if you are looking for it set whatever your file explorer is called to show hidden File/Folders. The data set has the same naming convention as the primary data set and is stored in the default location on the secondary computer’s hard drive, but it’s not a duplicate of the primary data set. They are not interchangeable. In normal operation Moneydance on your devices reads and writes to the Dropbox folder “.moneydancesync”, creating small transaction files (mdtxn files) in such a way that there should never be any conflicts (at least not to any important files). Filenames are unique and the data is encrypted using your sync key (“Encryption Passphrase”). All changes are recorded in this folder and if any of the changes cause conflicts then they are resolved by checking timestamps that are internal to the file (i.e. not the file modification date).

    Just one other point concerning backups in the unlikely event something should go wrong.

    Moneydance 2017 has an automatic daily backup which you can set up under FILE – PREFERENCES - BACKUPS and a manual backup “Export Backup” which you can perform at any time. You can set these backups to use Dropbox in case you have a hard drive failure. If you set a password under FILE – PASSWORDS these files will be encrypted. Don’t rely on external methods alone for backups. When Moneydance makes a backup and you use FILE - RESTORE FROM BACKUP as part of the process it sets syncing method to “Don’t Sync”. This allows you to start syncing afresh. In a backup of your data set made by other means syncing will still be ON. This could mean if the reason you wanted to revert to a backup was something to do with syncing you could be back in problems as it syncs with the data in the Dropbox ”.moneydancesync” folder. Also, don’t use the same backup location in Dropbox. The reason for this is auto backup files in the same day, primary and second computer have the same backup name and would end up overwriting each other. You could end up with a restored backup that you want to use on your primary computer that want let you change the syncing method.

    So, as you can see, providing a means to lock file would defeat the whole purpose of Moneydances internal Syncing engine.

    Hope this helps.

  5. 5 Posted by bernard on 14 Apr, 2018 10:02 AM

    bernard's Avatar

    Thanks Derek,

    I’m indeed on Mac and did purchase direct from Moneydance not through Apple App Store. Event though, I see no Dropbox folder sync option.

    As for the Dropbox connection api, it did fail to setup properly and was hanging in the air. Also I don’t like much the requirement to be online (even though I mostly am).

    I’ll give another try to Dropbox connection or try to figure out why I don’t see Dropbox folder option.

    Thanks for tip on backup folder. I did set up backup on same Dropbox folder and will fix this.

    Kind regards,

    Bernard

  6. 6 Posted by derekkent23 on 14 Apr, 2018 10:28 AM

    derekkent23's Avatar

    I am not support staff, just a user.

    Strange you don’t see the Dropbox Folder as a syncing option.

    I am a windows user and the Dropbox folder is present on my C drive at C:\Users\user_name\Dropbox.
    I know that other windows users have had problems if they did not allow Dropbox to install its folder in the default location. Moneydance can’t find it in a non-default location.

    Perhaps Mac users or Support could help with the reason for the absence of the sync method Dropbox folder on your Mac.

  7. 7 Posted by dwg on 14 Apr, 2018 10:31 AM

    dwg's Avatar

    I'm a fellow user,

    What you have described as good practice is applicable to Moneydance 2015 and earlier, with the way Moneydance syncing works in Moneydance 2017 this should not be necessary. Moneydance is expected to be working on syncing updates in the background, especially as one of the capabilities of this version is that it allows for simultaneous use of the data by multiple users.

    Versions of Moneydance directly obtain from the TiK website support three connection methods; Dropbox folder, Dropbox Connection and shared folder As I understand it the mechanism to determine if the Dropbox folder option is to be displayed during the syncing selection is if the dropbox client is installed using the default location for the folder, a very simple mechanism but not always correct. If you have installed the client using a non-default directory, as some users do, then you can use the shared folder option and navigated to where the dropbox folder has been placed.

  8. 8 Posted by bernard on 14 Apr, 2018 02:43 PM

    bernard's Avatar

    @derek On my Mac, Dropbox is in external disk.
    I solved this my crate a symlink from the terminal

    cd ~
    ln -s /Volumes/MacProSTORAGE/Clouds/Dropbox
    
    Now Dropbox Folder is available as Sync Method

    What is the benefit of using Dropbox Folder rather then Shared Folder?

    wkr,
    Bernard

  9. 9 Posted by bernard on 14 Apr, 2018 04:12 PM

    bernard's Avatar

    :-/

    The differences I can spot between Shared Folder and Dropbox Folder are:

    • I can choose a folder when I use Shared Folderwhile I cannot when I use Dropbox Folder. Dropbox shred folder is Dropbox/.moneydancesync/
    • when synched on Dropbox Folder, I can see data on my iPad

    However I don't like hidden folders and rather prefer to manually pick Dropbox/Applications/Moneydance which seem more usual behaviour.

    What other differences ?

    wkr

    Bernard

  10. 10 Posted by derekkent23 on 14 Apr, 2018 08:03 PM

    derekkent23's Avatar

    I am not support staff, just a user.

    If you are syncing to a mobile device, iPad, Phone etc then you can’t use Shared Folder.

    The Mobile APP uses a API to connect to your Dropbox account in the cloud. However, you can still use Dropbox folder on your computers, you are not forces to use Dropbox Connect.

    The way you have set up Dropbox on an external drive and allowed Moneydance to see it by crating symlink is something I am not sure of. Others have tried to use external drive and after a period of use have run into data corruption due to time lag problems with the transfer of large number of small files. Just don’t know if this would be an issue with your setup.

    May be dwg has some thoughts on this?

    I THINK SUPPORT SHOULD SET IN TO COMMENT

  11. 11 Posted by dwg on 14 Apr, 2018 09:32 PM

    dwg's Avatar

    Dropbox folder is a very specific example of a Shared Folder connection with a pre-defined folder location, you can think of it as nothing more than a shortcut to the default location of the dropbox folder.

    Using a symbolic link to be able to use the dropbox folder via its default location I do not see causing any problems, this is invisible to Moneydance and is a pretty standard methodology in Unix. Windows can do some things like it but you do not often see this type of approach employed on Windows.

    While your data set should be on a local drive, the way that moneydance interacts with the syncing data is that it allows for locations that are slower, it has to as passing data between systems requires the use of a network. so for this particular purpose I do not see an external drive as creating an issue, the slowest part is still going to be the dropbox client syncing data between the local machine and the dropbox server. Remember that with Shared folder Moneydance itself is reading/writing data to a server somewhere so could be relatively slow and with Dropbox Connection it is using the API to write to the dropbox server which is likely to be slower again.

  12. 12 Posted by derekkent23 on 14 Apr, 2018 10:19 PM

    derekkent23's Avatar

    Hi, dwg thanks for your input on this.

  13. 13 Posted by dwg on 14 Apr, 2018 10:46 PM

    dwg's Avatar

    Hi Derek, you are welcome.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac