Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Updated 27-Dec-11 22:50pm
v2
Comments
Mehdi Gholam 28-Dec-11 5:02am    
What do you mean by huge (large data size or large number of time)?
Rajesh Anuhya 28-Dec-11 5:02am    
Large Size(more than 30kb)
Mehdi Gholam 28-Dec-11 5:11am    
Take a look at my RaptorDB article for really fast insert performance.
Timberbird 28-Dec-11 5:10am    
Sorry, I couldn't see: which files are mixing? Files from different devices cannot mix - they have different names. Files sent one after another from the same device can mix, second overwriting the first, but you mention writing them to different directories - where does second folder come from?
Rajesh Anuhya 28-Dec-11 5:21am    
Files sent from one after one from same device is also not mixed, because i am saving in different file(Filename : DDMMYYYYHHMISSFFF). but this is not problem.

where the data landing on to my server at same time from different devices, those data is mixing, even am writing in different mechindid floders. :-(

1 solution

Solution Found.

After a long struggle, I observed that the data is mixing at the sender level, my web service is fine.

** This answer is posting myself.

Thanks
--RA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900