Page 1 of 2

File database is locked

Posted: Thu Mar 14, 2019 6:53 pm
by polinom
Good evening.
Yandex Disk does not want to update the database file, it says that the database is locked. If you close Cintanotes, the database is updated, but after restarting the computer, the situation repeats. Neither after 2 minutes, nor after 30 minutes the file is not updated. What can be done?
https://yadi.sk/i/kTK2M5Z1hhwAmQ

Re: File database is locked

Posted: Fri Mar 15, 2019 3:49 am
by gunars
Yandex Disk is probably similar to the Dropbox I use. Check your cintanotes.settings file and make sure you have:

notebook.disconnect.enabled = 1

It might also help to have:

notebook.disconnect.timeout.seconds = 10

This will enable CintaNotes to release control of the database after you make a change so that Yandex Disk can synchronize it.

Re: File database is locked

Posted: Fri Mar 15, 2019 10:47 am
by CintaNotes Developer
I join in to Gunars' advice.
(Thanks, btw!)

Re: File database is locked

Posted: Fri Mar 15, 2019 11:26 am
by polinom
gunars wrote:Yandex Disk is probably similar to the Dropbox I use. Check your cintanotes.settings file and make sure you have:

notebook.disconnect.enabled = 1

It might also help to have:

notebook.disconnect.timeout.seconds = 10

This will enable CintaNotes to release control of the database after you make a change so that Yandex Disk can synchronize it.



These parameters were not in the file. Inserted rows, still not synchronized.

Re: File database is locked

Posted: Fri Mar 15, 2019 3:16 pm
by gunars
Make sure this setting change exists on each machine you're syncing. Also, make sure you restart CN on each so the settings take effect.

Are you using the portable version of CN or the installed one? Which Windows and which CN version? I use the portable version from a folder in Dropbox so that the same version/settings are used no matter which machine I'm on (win 7, win 10). I'm not sure where the cintanotes.settings file goes for the installed CN, so maybe there's some issue there.

Re: File database is locked

Posted: Fri Mar 15, 2019 5:20 pm
by CintaNotes Developer
That's very strange that the parameters were not in the file. I'd suggest this might be the wrong file.
Could you please post the path to cintanotes.exe and cintanotes.settings that you edited?

Also note that you should always exit CN before editing cintanotes.settings, otherwise your changes will be overwritten.

Re: File database is locked

Posted: Fri Mar 15, 2019 6:17 pm
by polinom
CintaNotes Developer wrote:That's very strange that the parameters were not in the file. I'd suggest this might be the wrong file.
Could you please post the path to cintanotes.exe and cintanotes.settings that you edited?

Also note that you should always exit CN before editing cintanotes.settings, otherwise your changes will be overwritten.


The path to cintanotes.exe : C:\Program Files (x86)\CintaNotes
The path to cintanotes.settings : c:\Users\polinom\AppData\Roaming\CintaNotes\
I did not leave the application, while cintanotes.settings is edited and saved.

Re: File database is locked

Posted: Fri Mar 15, 2019 6:22 pm
by polinom
gunars wrote:Make sure this setting change exists on each machine you're syncing. Also, make sure you restart CN on each so the settings take effect.

Are you using the portable version of CN or the installed one? Which Windows and which CN version? I use the portable version from a folder in Dropbox so that the same version/settings are used no matter which machine I'm on (win 7, win 10). I'm not sure where the cintanotes.settings file goes for the installed CN, so maybe there's some issue there.


Tomorrow I will try to set up the same file cintanotes.settings on both computers. Win 7, local version 3.13.

Re: File database is locked

Posted: Fri Mar 15, 2019 6:38 pm
by polinom
When loading Windows, Yandex disk cannot access the database. I close CN, Yandex disk synchronizes the database and all its changes, even if the CN is open. If the database is changed on the second computer, on the first computer the Yandex disk again cannot access the database.

Re: File database is locked

Posted: Sat Mar 16, 2019 5:37 am
by CintaNotes Developer
polinom wrote:I close CN, Yandex disk synchronizes the database and all its changes, even if the CN is open.

This seems to be a bit self-contradictory, could you elaborate please?

Re: File database is locked

Posted: Mon Mar 18, 2019 3:39 pm
by polinom
CintaNotes Developer wrote:
polinom wrote:I close CN, Yandex disk synchronizes the database and all its changes, even if the CN is open.

This seems to be a bit self-contradictory, could you elaborate please?


If you close the CN, the Yandex disk gets access to cintanotes.db and updates it from the cloud. After that, I launch CN again, add a note, and the Yandex disk immediately copies cintanotes.db to the cloud, without delay. If cintanotes.db is changed on another computer, you will have to repeat the whole procedure again.

Re: File database is locked

Posted: Tue Mar 19, 2019 10:13 am
by polinom
gunars wrote:Make sure this setting change exists on each machine you're syncing. Also, make sure you restart CN on each so the settings take effect.

Are you using the portable version of CN or the installed one? Which Windows and which CN version? I use the portable version from a folder in Dropbox so that the same version/settings are used no matter which machine I'm on (win 7, win 10). I'm not sure where the cintanotes.settings file goes for the installed CN, so maybe there's some issue there.


Set identical settings on each computer, the problem remains.

Re: File database is locked

Posted: Tue Mar 19, 2019 10:16 am
by polinom
What is the cintanotes.db-journal file for?

Re: File database is locked

Posted: Tue Mar 19, 2019 10:17 am
by CintaNotes Developer
What version of YD do you have? Did you update to the latest version?

Re: File database is locked

Posted: Tue Mar 19, 2019 10:49 am
by polinom
CintaNotes Developer wrote:What version of YD do you have? Did you update to the latest version?


Yandex Disk version 1.4.22. Version 3.0 is raw, there are some problems with data loss, so I use the old version.

Re: File database is locked

Posted: Tue Mar 19, 2019 3:45 pm
by polinom
By the way, the exact same problem: viewtopic.php?t=2554

Re: File database is locked

Posted: Tue Mar 19, 2019 4:31 pm
by polinom
Launched Process Monitor, it turned out CN accesses the database every 10 seconds. I attach my CN settings file to the screenshot.
https://yadi.sk/i/do-vsDpbIE6suA
cintanotes.settings

Re: File database is locked

Posted: Wed Mar 20, 2019 8:31 am
by CintaNotes Developer
That's very interesting.
I checked the settings file, notebook disconnect is set at 10 seconds, which corresponds to the period you're observing.
We need to determine what code is called that requires DB access.
Could you please turn on the debug log in CN and record several such events?
This would definitely shed light on the issue.
Thanks!

Re: File database is locked

Posted: Thu Mar 21, 2019 9:44 am
by polinom
CintaNotes Developer wrote:That's very interesting.
I checked the settings file, notebook disconnect is set at 10 seconds, which corresponds to the period you're observing.
We need to determine what code is called that requires DB access.
Could you please turn on the debug log in CN and record several such events?
This would definitely shed light on the issue.
Thanks!


Made a log: https://yadi.sk/i/GtMKHiZqxPazeA

Re: File database is locked

Posted: Thu Mar 21, 2019 7:35 pm
by CintaNotes Developer
Thanks a lot! According to the log, database disconnect never happens.
Most probably this is because the program is kept on screen and is never minimized to tray.
When the program is on screen, it keeps database locked to prevent database reconnection freeze when the user switches back to it.