Periodically I get an error when working with files from the database. Entity Framework
, on the base Filestream
which is used to store files. I can not understand why this error takes off:
FILESTREAM close operation using the same transaction. The transaction will be rolled back.
Maybe someone saw a similar error and how did you fight it ?!
Usually flies to commit
or SaveChanges
In the SQL
profiler, I found the following entries: First error:
2013-06-26 09:44:00.74 spid10s Error: 3910, Severity: 16, State: 1. 2013-06-26 09:44:00.74 spid10s Transaction context in use by another session
It belongs to the master
database.
The remaining errors in my database. After this, two errors begin to fall: This operation conflicts with another pending operation on this transaction. The operation failed. This operation conflicts with another pending operation on this transaction. The operation failed.
And at the end another mistake:
The transaction has been stopped because it conflicted with the execution of a FILESTREAM close operation using the same transaction. The transaction will be rolled back.
Most recently, I discovered that an error only occurs when the next request is not executed, while the profiler for this request is in the column DataBaseName='master'
. Here is the query:
UPDATE [Docs].[dbo].[Files] SET [file_body] = [file_body].NewFilestreamValue () WHERE [file_body].RowGuid () = @hint OPTION (MAXDOP 1)
I didn’t find what the NewFilestreamValue()
function NewFilestreamValue()
and where you can read about it, maybe it will give a clue