Lock on a database file

Gloops

Well-known member
Joined
Jun 30, 2022
Messages
137
Programming Experience
10+
Hello everybody,
On a SQL file database (MDF file), SSMS raises me an error when I try to display the data of a table :
C#:
Activity Monitor Log 
[TABLE]
[TR]
[TD]SyncLock called without an initialized synchronization object[/TD]
[/TR]
[/TABLE]

When giving it the path, ProcExp only finds explorer.exe, and it is normal as I displayed the folder. It appears two times in the list, I did not deepen this.
Any idea what is on?

It is the Northwind database, here is the structure of the table:
Structure of the Category table (creation script generated by SSMS):
USE [D:\PROJECTS VISUAL STUDIO\WINFORM\EF6WINFORMS\SAMPLE\NORTHWND.MDF]
GO

/****** Object:  Table [dbo].[Categories]    Script Date: 29/09/2022 15:29:05 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Categories](
    [CategoryID] [int] IDENTITY(1,1) NOT NULL,
    [CategoryName] [nvarchar](15) NOT NULL,
    [Description] [ntext] NULL,
    [Picture] [image] NULL,
 CONSTRAINT [PK_Categories] PRIMARY KEY CLUSTERED
(
    [CategoryID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
 
Last edited by a moderator:
The "SyncLock" referred to above sounds like a method is some chunk of code. It is not a filesystem lock. It sounds like SSMS has some kind concurrency bug internally.
 
Hum, so you mean I should refer to Microsoft ?

By the way, it is strange that this only happens with a file database.
 
If you do a search for "SyncLock called without an initialized synchronization object" the error seems to primarily come up with SSMS not even able to start up. So, yeah, open a support a ticket with Microsoft.

What's wrong with using the database explorer built into Visual Studio if all you need to do is look at the data?
 
Well, the first time I tried, the data was displayed in SSMS and in the server explorer, so I thought it was the same ...
In fact there is quite a history with that, an Entity Framework project failed to access the database, I was invited to repair SQL Server with its installation program.
Well, the first time, the hard disk had to be changed.
New attempt with a new disk, the installation program failed because of a lock error.
I was invited to try with an older disk image, this time the installation program succeeded.
But, the Entity Framework project (from codeproject.com) failed.
So I wanted to access the data from SSMS to verify, and there it also fails.
Could you use Entity Framework on WinForms recently?
 
I don't use EF.
 
Complement of information concerning SSMS.
I opened this thread by reporting a problem with version 15.0.18386.0 of SSMS.
It seems version 15.0.18424.0 of SSMS displays the category table properly, except I just had to adjust the widths of the columns.
Between both the size of the download is 694 MB.
 
Last edited:
I don't use EF.
Hello,
In fact, nobody here answered, using EF.
And I see that the most recent job description I received mentioning Entity Framework is two years old.
Can we consider this as abandoned?
It seems there is still work to do to follow-up the solution of the errors that appear, so it is good to know whether that is about to be useful.
SSMS was corrected, perhaps they are about to correct SQL Server Express generally speaking, too. I presume it is a good idea to adjust the stress level to the situation.
 

Latest posts

Back
Top Bottom