Hi..,
After a long time i am posting a Question in Code Project. I very much distributed with this problem. Presently even i am not in a position to where is the problem is occurring.
Please read my entire thread to understand my problem clearly.
Project : I developed a Project for one of the reputed Bank in India for Collecting the loan amounts in remote locations. Every Collection Agent have Device(Linux, GPRS enabled) to collect the loan amounts. Every device will send the payment receipt details to the server immediately if GPRS connection is available(which is very less data(200 bytes)). If gprs is not there it will store in the internal memory, when the device came into GPRS area it will send total data(which is very high).
Web service : Web service will receive the data from Device and saving into the file(filename: mechineid[unique]+datetime) then dumping into the database, sending back Acknowledgment to the device in same session
** it is working fine for the small amount of data(when GPRS is available). But when device is sending to the huge data it's also receiving fine.
Problem : There are 1200+ devices in the field, which are send the huge data regularly.
some device are sending data at same fraction of second that data is merging into one file. i am writing this files in two different folders even those files are mixing. i am not able to trace what is exactly happening.
Here is the code for writing file
public string Execute_DCR(ref Globals.Globals.CliRequest ObjClient, ref Globals.Globals.RequesInfo HttpReq, string MechineID, string FileBytes)
{
string return_str = "^NACK@";
string BranchCode = Pick_Brach_Code(MechineID);
string TempFIlename=ConfigurationManager.AppSettings["isbnPath"] + "\\" + BranchCode + "\\upload\\" + MechineID + "_" + DateTime.Now.ToString("ddMMyyyyHHmmss") + ".dat";
FileStream Fs = new FileStream(TempFIlename, FileMode.CreateNew, FileAccess.Write);
BinaryWriter Bw = new BinaryWriter(Fs);
Bw.Write(Encoding.UTF8.GetBytes(FileBytes));
Bw.Close();
Fs.Close();
DumpToSQL(TempFIlename);
return_str = "^ACK@";
HttpReq.Respocestring = return_str;
ObjClient.Command = return_str;
return return_str;
}
Server : Windows Server 2008 R2, IIS 7.5. Framework 3.5, Sql Server 2005,
for more information drop a comment under the question.
Please get back to me on this, waiting for your reply,
Thanks in advance.