Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have two programs:
1. a software that send data all the time to an api and the api save this data into the DB
2.a web that uses a worker that runs every 500 ms and save data into the DB

they both saves the same row, different fields

when one of them works:
the web load all the data is needed to the page like it should

when both of them works:
it takes a very long time till all the data is loaded to the page

i'm using stored procedure, and EF 6

here's the code that both worker and api are using to save data:
C#
using (DBEntities db = new DBEntities())
           {
               var a = db.sp_SaveScale(item.GUID, item.MAC, item.CompanyID, item.Status, item.Weight, item.WeightDate, item.Active, item.Name, item.ScalesTypeID).ToList();
               if (a.Count() > 0)
                   item.GUID = (long)a.ElementAt(0);
           }



the stored procedure 'sp_SaveScale' saves all the record

what i need to do to fix the loading problem?
I need both worker and api, to work continuously

What I have tried:

I've tried delay both worker and api but still didn't help
Posted

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