Forum

Forum breadcrumbs - You are here:ForumGeneral: Chit-chatDatabase Locking Issue
Please or Register to create posts and topics.

Database Locking Issue

I am currently using RootsMagic 10 and have written an application in C# to create citations for existing sources.  My application creates an SQL Statement pulling information from the facts to populate the citation.  Once the statement is created it is saved to a file.  I then use SQL Command Line Tools, which loads the unifuzz64.dll for RMCASE, and run the script.

This all works great, and I have had no issues with my database (integrity checks out ok when I run it).  I am having one weird issue that occasionally comes up.  9 times out 10 I can work in, and leave open, RootsMagic while still creating the citations.  At random times when I go to create the citation my application will report that the database is locked.  The only resolution is to close down Roots Magic.  I point that out because I do not believe it is my application that is leaving the database locked.  I have closed it down and reopened it with the same issue.

Any ideas as to what would be causing this?

Thanks

Charles

kevync has reacted to this post.
kevync

I know that running a backup locks the file.

I've witnessed errors reported from RM that the database is locked. That suggests there is still a process running on it which might be a background thing, or a hung one.

I would turn off hints, TreeShare, and Family search support. Additionally, make sure that the database file is not being processed by an external backup or cloud sync service.

Tom

I have seen the same thing randomly while running scripts using SQLiteSpy rather than from the command line. The probability of it happening seems to increase the longer I use SQLiteSpy and RM together. And by "together", I don't mean literally at the same time. I as the use am using only RM or only SQLiteSpy at one time. But I switch back forth without shutting either RM or SQLiteSpy down.

There appears to be no repeatable cause. That that suggests that Tom's theory about background processes running in RM is probably correct.

kevync has reacted to this post.
kevync

Thanks, guys, for your comments.  Turning off tree share and /or hints would defeat what I am doing with RM.  I know that there are no backups running and I don't know what type of background process RM would be running.

As I said, I do keep RM open and use my application.  Today, for example, I added 8 citations without any issue.  While keeping both RM and my application open I created several facts; two new sources and made changes.  On the 9th attempt to add a citation I received an error message that the database was locked.  As soon as I closed the database, I was able to add the citation.

kevync has reacted to this post.
kevync