facebook

Cache Problem?

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #302085 Reply

    Nelson999
    Member

    I have what seems to be a cache problem that I can’t seem to fix. I’m using MyEclipse 7.5, IceFaces 1.8.1, EclipseLink, and connecting to a MySQL DB version 5.1. If I do an update to the DB, the update works. What I see when I do a IceFaces datatable refresh is that my updated data comes back right away. (that’s good) Now if I press the refresh button again it varies as to what data it gives me. Sometimes it gives me the old data and sometimes it gives me the updated data. I’ve tried adding the following to my EntityManagerHelper in the createQuery field but with no success. (.setHint(QueryHints.REFRESH,HintValues.TRUE);) The refresh does not seem to help. Any ideas?

    #302135

    Loyal Water
    Member

    Hi,
    This is a weird issue. I’ll check with the dev team but I would suggest you cross post this query on the ICEFaces and MySQL forums as well

    #302215

    Nelson999
    Member

    Thanks. I’ll see if I can get a response from IceFaces. This to me would not seem like a MySQL problem but I can’t entirely rule that out. Just to let you know, I also tried the following in my persistence.xml file but to no avail as well.
    – I’ve also tried adding <property name=”eclipselink.cache.type.default” value=”NONE”/> to my persistence.xml file with no success. I also modified default size and whether it was shared as well.

    if you find out anything from the dev team, I’d be very interested in hearing what they have to say.

    Thanks

    #302250

    Nelson999
    Member

    Here is everything I’ve tried thus far:
    – EntityManagerHelper.java file: getEntityManager().createQuery(query).setHint(QueryHints.REFRESH,HintValues.TRUE);
    – Persistence.xml file:
    <property name=”eclipselink.cache.shared.default” value=”false”/>
    <property name=”eclipselink.cache.size.default” value=”0″/>
    <property name=”eclipselink.cache.type.default” value=”NONE”/>
    – And from within my .java file inside a transaction (except for closing the EM):
    EntityManagerHelper.getEntityManager().flush();
    EntityManagerHelper.getEntityManager().clear();
    EntityManagerHelper.closeEntityManager();

    I’ve tried each of these separately and all at the same time. It still doesn’t solve my refresh problem.

    Ideas?

    #302261

    Nelson999
    Member

    Well, I have found a solution that works for me. After I call my DAO.findAll or DAO.findById, I then call
    EntityManagerHelper.getEntityManager().refresh(tempList.get(i));
    where my tempList is a copy of my DAO object. After testing for over an hour, I’ve had no problems.

    #302264

    Loyal Water
    Member

    Glad you found the solution. Thanks for letting us know.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Cache Problem?

You must be logged in to post in the forum log in