开发者

RequestFactory - no consistent data from DB

i am exprimenting with the RequestFactory and managed to get Data from it and it worked like it should and i get all my data.

But when i refresh the page it doesn't get new data from the server. It looks like it cache the data and use the old. My EclipseLink JPA don't tell me new database queries , also i changed the data in the DB and i only get the old data.

I use that query:

requestFactory.projectRequest().findAllProjects().fire(new Receiver<List<ProjectProxy>>() {     

            @Override
            public void onSuccess(List<ProjectProxy> response) {
                view.setProjects(response);             
            }

    开发者_JS百科    });

on the server side:

public static List<Project> findAllProjects() {
        EntityManager em = entityManager();
        try {
          List<Project> list = em.createQuery("select p from Project p").getResultList();
          // force to get all 
          list.size();
          return list;
        } finally {
          em.close();
        }
      }

Where am i wrong? onModuleLoad gets called on refresh.


This is probably the JPA/eclipselink cache. If you modify data outside your application, like directly editing the database it's not picked up directly. See also this question and answer: Disable caching in JPA (eclipselink)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜