0

I have hosted Java Web application developed using RestFul Web services, hibernate and angularjs. MySql is the DB. After Hosting in Tomcat, restful webservices GET calls are not pulling correct data from the DB after making a transaction.

i.e.,

  1. GET call is accessed for a resource
  2. POST call is made to the Resource
  3. Again the GET call is made, which shows the initial values alone but not the newly posted entry.

This happens in few machines only. While in few other machines, it works as expected. I have cleared the browser cache as well. still not working.

Please help on this.

Raptor
  • 53,206
  • 45
  • 230
  • 366
  • Seems to me that either the GET request was cached by an intermediate server or that the POST request did not work as expected explaining that the data was not updated. I think that Angularjs allows you to add some headers that explicitly forbid request caching to intermediate servers. Can you access the database in order to check if your data was really modified? – Arnaud Denoyelle Jul 21 '15 at 10:20
  • Thanks for your reply. Yes. DB is having the newly posted data. Just the second GET call does not reflect the same – Kirthi Deva Jul 21 '15 at 10:24
  • I think that this question is about the same problem : http://stackoverflow.com/questions/16971831/better-way-to-prevent-ie-cache-in-angularjs The advice is to use a "no-cache" header on the the reponse, on the server side. – Arnaud Denoyelle Jul 21 '15 at 10:27
  • Thanks a lot for your reply. I will try it out and get back whether it works or not. – Kirthi Deva Jul 21 '15 at 10:47
  • @ArnaudDenoyelle: The Second answer from the url which you shared worked for me.. Thanks a ton. – Kirthi Deva Jul 23 '15 at 10:50

0 Answers0