Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:43:52+00:00 2026-06-03T01:43:52+00:00

I have an ASP.Net MVC 3 app that I’ve developed which uses RavenDB Embedded

  • 0

I have an ASP.Net MVC 3 app that I’ve developed which uses RavenDB Embedded as an integrated backing store for data, I used this tutorial as a basis for getting started creating an MVC app with RavenDB Embedded. I’ve been able to run it fine on my development PC, but when it came time to deploy it on our Windows Server 2003 web server running IIS6 it threw the following error:

Cannot access file, the file is locked or in use Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.

Exception Details:
Microsoft.Isam.Esent.Interop.EsentFileAccessDeniedException: Cannot
access file, the file is locked or in use

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.

Stack Trace:

[EsentFileAccessDeniedException: Cannot access file, the file is
locked or in use] Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
in
C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\Api.cs:2736
Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator
uuidGenerator) in
c:\Builds\RavenDB-Stable\Raven.Storage.Esent\TransactionalStorage.cs:207

[InvalidOperationException: Could not open transactional storage:
C:\inetpub\wwwroot\MyApp\App_Data\Database\RavenDB\Data]
Raven.Storage.Esent.TransactionalStorage.Initialize(IUuidGenerator
uuidGenerator) in
c:\Builds\RavenDB-Stable\Raven.Storage.Esent\TransactionalStorage.cs:222
Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration
configuration) in
c:\Builds\RavenDB-Stable\Raven.Database\DocumentDatabase.cs:185
Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal() in
c:\Builds\RavenDB-Stable\Raven.Client.Embedded\EmbeddableDocumentStore.cs:143
Raven.Client.Document.DocumentStore.Initialize() in
c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Document\DocumentStore.cs:496
MyApp.CompositionRoot.CreateControllerFactory() in
…\MyApp\CompositionRoot.cs:36 MyApp.CompositionRoot..ctor() in
..\MyApp\CompositionRoot.cs:17
MyApp.MvcApplication.Application_Start() in …MyApp\Global.asax.cs:38

[HttpException (0x80004005): Could not open transactional storage:
C:\inetpub\wwwroot\MyApp\App_Data\Database\RavenDB\Data]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext
context, HttpApplication app) +3985477
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
appContext, HttpContext context, MethodInfo[] handlers) +191
System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +375

[HttpException (0x80004005): Could not open transactional storage:
C:\inetpub\wwwroot\MyApp\App_Data\Database\RavenDB\Data]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)
+141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +4782309

The source of the error in the referenced CompositionRoot.cs class is when the initialization of the Embeddable Document Store.

private static IControllerFactory CreateControllerFactory()
{
    var cacheRepository = new EmbeddableDocumentStore();
    cacheRepository.ConnectionStringName = "RavenDB";

    #if DEBUG
        cacheRepository.UseEmbeddedHttpServer = true;
    #endif

    Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);
    cacheRepository.Initialize(); //Source of Error
    var controllerFactory = new TDRControllerFactory(cacheRepository);
    return controllerFactory;
}

Why is this only happening on the web server and not on my development PC? I’m not sure what the exact cause might be. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:43:53+00:00Added an answer on June 3, 2026 at 1:43 am

    This turned out to be a permissions issue, I gave the IIS_IUSRS group modify and write permissions on the root of my application’s folder and that gave it the permissions it needed to initialize the database properly. There’s probably a specific folder within the root that it needs modify/write access to (in my case, probably the App_Data folder, since that’s where I’m instantiating my instance of RavenDB). I’ll have to test as I wouldn’t want any user to have modify/write rights to the entire application folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC 3 app that uses Amazon S3 to store movie
I have an ASP.NET MVC server app and client code which uses jquery. I'd
I have an ASP.NET MVC 2 app that uses URLS such as: /rsvp/33c4cf68-a2fe-4c0f-9834-08838e0532c3 /rsvp/4f28dad7-b05c-4887-818f-b4ae664b7192
I have an asp.net MVC web app that processes images and resizes them which
I have an ASP.NET MVC app which has a bootstrapper class that configures log4net
I´m developing an ASP.NET MVC app that uses EF 4.1 Code First. I have
I have put together a simple ASP.NET MVC 3 test web app that uses
So, I have an asp.net mvc app that is being worked on by multiple
In my ASP.NET MVC app, I have a fairly complex edit page which combines
In my ASP.NET MVC app, I have an interface which acts as the template

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.