sellmeadog
sellmeadog

Reputation: 7517

Umbraco - SQL Server CE - There is a file sharing violation. A different process might be using the file

I've installed Umbraco 4.7.2 configured to use SQL Server CE into a GoDaddy 4GH shared hosting account. Initially, the site ran as expected. However, I quickly realized that no subsequent/concurrent connections are allowed and am receiving the following:

System.Data.SqlServerCe.SqlCeException: There is a file sharing violation. A different process might be using the file. [ ..\App_Data\Umbraco.sdf ]

I've done some research and I understand that SQL Server CE doesn't allow multiple connections, but I find it hard to believe that Umbraco would offer SQL Server CE as an option if it wasn't capable of allowing multiple visitors to navigate a site.

I've tried modifying the connection string per other resources and am not having any luck. Here's my current connection string:

datalayer=SQLCE4Umbraco.SqlCEHelper,SQLCE4Umbraco;data source=|DataDirectory|\Umbraco.sdf;file mode=read write;persist security info=false;

I've tried different file modes such as Read Only and Shared Read with no luck. How do you overcome this issue? Is this somehow a problem with the hosting environment or a problem with the connection string?

Upvotes: 0

Views: 2993

Answers (1)

mortenbock
mortenbock

Reputation: 671

It looks like your hosting environment might not support using SQL CE databases.

According to this page http://support.godaddy.com/help/article/4883/4gh-frequently-asked-questions it cannot support:

Concurrent file writes to the same file in multiple sessions or concurrent threads. Example of affected resources: File-based databases and cross session log files (these issues are exaggerated in a 4GH environment due to additional volume).

It looks like it is actually a distributed environment, which shares the file system between multiple servers, which causes the locking issue.

So I guess the solution would be to move to a traditional hosting product, with only one server.

Umbraco does have support for running in a distributed environment when using a SQL server (non-CE), but that requires that you know all the servers up front, as it needs to make calls to other instances to refresh caches etc., and i don't think you can get that with your current hosting product.

You could try to upgrade you database to a full SQL server in you current setup, but I'm not sure it would work too well.

Upvotes: 1

Related Questions