Errors in the Event Viewer when the PersistentDictionary writes to a network share

Jul 19, 2013 at 7:30 PM
We are using the PersistentDictionary to cache data. We do not have enough disk space on our local drive to store the data so our output location for the data is a network drive. The dictionary works and stores the data on the network drive, however, the Event Viewer is flooded with the following error:

An attempt to open the device name "\ServerA\ShareA" containing "\ServerA\ShareA\" failed with system error 5 (0x00000005): "Access is denied. ". The operation will fail with error -1032 (0xfffffbf8)

In our scenario our output location is: \ServerA\ShareA\FolderA\FolderB\FolderC\FolderD. Our user has read/write access to every directory in that file path. However, we get the error above in the Event Viewer but the data still gets written to the file. How do we fix this problem so the Event Viewer no longer gets these errors logged?

Jul 20, 2013 at 3:55 AM
Edited Jul 20, 2013 at 3:55 AM
Have you tried mapping a network drive and accessing your database at "S:\Folder" instead of "\Server\Share\Folder"?
Jul 22, 2013 at 7:44 PM
Just confirming that the path actually starts with two backslashes; i.e. "\ServerA\ShareA\"

You can set SystemParameters.EventLoggingLevel to something else, like EventLoggingLevels.Min.

Jul 24, 2013 at 1:33 PM

We've tried using a map drive and we get the same error.
Jul 24, 2013 at 1:40 PM

The path does start with two backslashes. That's just a typo I made when posting.

If I change the EventLoggingLevels to Min will it hide valid errors that may occur?

How do I set the EventLoggingLevels to Min when using a PersistentDictionary? I see the documentation says to use Microsoft.Isam.Esent.Interop.Api.JetSetSystemParameter() but I don't see anyway to grab the JET_INSTANCE, etc. out of the PersistentDictionary. Do you have a small code snippet that illustrates how to do it?

Aug 6, 2013 at 7:16 PM
You are correct that PersistentDictionary.Instance is a private variable, not accessible by you.

You should just be able to directly use the SystemParameters class prior to starting the PersistentDictionary:
SystemParameters.EventLoggingLevel = <whatever>.

Generally the global SystemParameters class will set the default for any instances created after that.

Hope that helps,