1

I published my ASP.net web forms app on my hosting server,

after updating the data in the SQL database using entity framework, the app still returning old values.

Is this possible, or I'm going crazy.

Monir Tarabishi
  • 716
  • 1
  • 16
  • 30
  • Have you restarted the website? Make sure you clear your browser, by killing all sessions, clear the cache and the cookies. Let me know if this solves it – Chris Nov 12 '14 at 22:03
  • Yes my friend, i did all of this... sry it didn't – Monir Tarabishi Nov 12 '14 at 22:05
  • Silly question, but are you sure you are pointing to the right DB server? Double check your connection string and double-check the server where you 'think' you updated the data. Is it still happening? – Chris Nov 12 '14 at 22:06
  • Check 1. Connection string of your website 2. Url you are using 3. Data in the db are ready new 4. Use another browser to access website – Max Brodin Nov 12 '14 at 22:06
  • @Chris ... oh man I know it's a stupid question ... but i checked the connection string and my database where the data is updated ... connected to the database from visual studio ... every thing is fine, but on the server it's driving me crazy – Monir Tarabishi Nov 12 '14 at 22:11
  • @MaxBrodin Sry buddy I even cleared the session and tried from another PC – Monir Tarabishi Nov 12 '14 at 22:11
  • So did you solve your problem? What was it? – Chris Nov 12 '14 at 22:12
  • @Chris No buddy ... still searching – Monir Tarabishi Nov 12 '14 at 22:16
  • here is the query: SELECT [LanguageId] ,[Name] ,[ShortCode] ,[Icon] ,[Active] FROM [DesertVessel].[dbo].[Languages] – Monir Tarabishi Nov 12 '14 at 22:17
  • Could be caching client or serverside – Ruben-J Nov 12 '14 at 22:24
  • If you are still seeing the old data, then there are only a few possible reasons: your DB changes have not been committed, you are connected to the wrong DB, you are connected to a DB snapshot which has not been updated, your data is in session and you haven't restarted your app/cleared session, your browser has cached the data, you use a browser data object to store your queries. Can you go through the list and eliminate all of the possibilities? – Chris Nov 12 '14 at 22:24
  • @Ruben-J What is serverside caching?? I'll look for this – Monir Tarabishi Nov 12 '14 at 22:29
  • @Chris I'll go through it right away – Monir Tarabishi Nov 12 '14 at 22:30
  • @iceDragon what was the outcome? – Chris Nov 13 '14 at 19:46
  • @Chris after 1 hour of updating data, they are available on the website, I sent a message to the hosting company about the server-side caching issue "which I heard about it from Ruben-J" still didn't get an answer. this is killing me with the client – Monir Tarabishi Nov 13 '14 at 20:59

1 Answers1

0

The problem was that I'm using a static Datacontext in Entity Framework. this is a huge mistake for a unit of work object. I just

My references:

Should data contexts be static?

Entity framework context as static

Linq to SQL DataContext Lifetime Management

Community
  • 1
  • 1
Monir Tarabishi
  • 716
  • 1
  • 16
  • 30