Hi,
In my VAF I am getting this error: System.Runtime.InteropServices.COMException (0x80040001): The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000)
From this command:
var newReport = templateDoc.CreateCopy(options);
I am running that from state change event (on one of the objects that I will be linkin later below, I called it obj2 there). I am then searching a template document and from that template document I am copying a new document, including the (Excel) file from the template document.
Options look like this (changed some names there, but the idea is to put couple of references to other objects, copy the source files from the template and checkin the new document):
var options = new ObjectCopyOptions()
{
CheckInComments = "Create dreport from template.",
CheckInObject = true,
CopySourceFiles = true,
CopySourceProperties = true,
Properties = new List<ObjectCopyOptions.PropertyValueInstruction>()
{
new ObjectCopyOptions.PropertyValueInstruction(ObjectCopyOptions.PropertyValueInstructionType.ReplaceOrAddPropertyValue,
Pts.Object1,
MFDataType.MFDatatypeLookup,
obj1.ID),
new ObjectCopyOptions.PropertyValueInstruction(ObjectCopyOptions.PropertyValueInstructionType.ReplaceOrAddPropertyValue,
Pts.objects2,
MFDataType.MFDatatypeMultiSelectLookup,
obj2.ID),
new ObjectCopyOptions.PropertyValueInstruction(ObjectCopyOptions.PropertyValueInstructionType.RemovePropertyValue,
(int)MFBuiltInPropertyDef.MFBuiltInPropertyDefIsTemplate,
MFDataType.MFDatatypeBoolean,
true)
}
};
This works fine on my local testing vault which uses Firebird, but this causes an error in customers vault which has SQLServer.
Stack trace looks like this:
at MFilesAPI.VaultObjectFileOperationsClass.UploadFileBlockBegin() at MFilesAPI.Extensions.FileUploadStream.OpenUploadSession() at MFilesAPI.Extensions.FileUploadStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize) at MFilesAPI.Extensions.VaultObjectFileOperationsExtensionMethods.AddFile(VaultObjectFileOperations objectFileOperations, ObjVer objVer, Vault vault, String title, String extension, Stream fileContents) at MFiles.VAF.Extensions.VaultObjectFileOperationsExtensionMethods.AddFile(VaultObjectFileOperations objectFileOperations, ObjVerEx objVerEx, String title, String extension, Stream fileContents) at MFiles.VAF.Extensions.ObjVerExExtensionMethods.AddFile(ObjVerEx objVerEx, String title, String extension, Stream fileContents) at MFiles.VAF.Extensions.ObjVerExExtensionMethods.CreateCopy(ObjVerEx source, ObjectCopyOptions objectCopyOptions, IObjectCopyCreator objectCopyCreator)
And the full error looks like this:
System.Runtime.InteropServices.COMException (0x80040001): The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) CoVaultObjectFileOperations.cpp, 996, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) ServerVaultObjectFileOperationsHelper.cpp, 635, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) CoRPCOverCOM.cpp, 8000, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) RPCDocumentOperationsFileIO.cpp, 670, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCallInLoop.h, 300, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCallInLoop.cpp, 809, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) RPCDocumentOperationsHelper.cpp, 22508, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) VaultDBSession.cpp, 659, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) VaultDBSession.cpp, 992, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) VaultDBSession.cpp, 925, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) DBSession.cpp, 792, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) DBSession.cpp, 1022, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) DBSessionBase.cpp, 146, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCommand.h, 584, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCommand.h, 843, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCommand.h, 801, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) MCommand.h, 583, The transaction operation cannot be performed because there are pending requests working on this transaction. (ERROR: 3981, SQLSTATE: 42000) (0x80040E14) (M-Files 25.9.15198.5 2025-10-22T07:34:27.003Z)
Any idea what could be the issue and how could I fix it? Just not use CreateCopy and instead create document separately and copy the file from the template document into it?
