We are using alchemy to Add approximately 5,000 files per day (not all they at the same time), this service is being called Alchemy at least 4 threads, uses a single connection, 1 by 1 file upload works acceptably, but the problem arises when we try to Add two or more files at the same time to Alchemy.
We use one single connection to Alchemy Data Base: In Global.asax, we create 1 objetc Alchemy.Application and Alchemy.DataBase, this object is instantiated and used by multiple threads and is never distroyed.
public static Alchemy.Application auapp { get; set; }
public static Alchemy.Database db { get; set; }
//creating Connection to BataBase
auapp = new Alchemy.Application();
auapp.LoadOptionsFile("");
db = auapp.Databases.Add("alchemy://WVMTESTRFAX01:3234/RFB.ald");
db.Login("Admin", "123"); //here the Authentication
How do we create the files?
Alchemy.Item Folder = db.GetItemByID(1234); //Get Principal Folder
Alchemy.Item _item = Folder.CreateItem(Alchemy.AuPosEnum.auPosLastChild, Path_file);
How do we extract the files?
Alchemy.Item _Item = db.GetItemByID(int.Parse(ID));
_Item.Retrieve(“Path to write”, false);
Problems
1.-The problem arises when we try to Add two or more files at the same time to Alchemy, ie when use Folder.CreateItem(“”,””) at the same time on different Threads.
Log:
System.Runtime.InteropServices.COMException (0x80040207): The owner SID on a per-user subscription doesn't exist (Exception from HRESULT: 0x80040207)
at Alchemy.IItem.CreateItem(AuPosEnum Position, String Path)
2.- Other problem arises when we try to extract a file from Alchemy, we do the next steps:
a.- Find Item on Alchemy using ID db.GetItemByID(#id);
b.- When Find it, we check that the Object Item not be null.
c.- We try to read de file on “Path to write” and convert it to Byte array, in this step some times the log say that the “File doesn’t exist”.
Any advice of what is happening?
I have installed WindowsServer2008 (64 bits). RAM:4GB.
IIS 7
Code on: C# .net (Visual Studio 2010)
Applicaction Pool is using FrameWork 4.0, 32-Bit Applications Compatibility using: AuApiX.dll
Alchemy 9.0 Build 100.102