Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » (no subject)
(no subject) [message #696991] Fri, 15 July 2011 09:21
Sebastian is currently offline SebastianFriend
Messages: 26
Registered: July 2009
Junior Member
Hi All,


I have a cached namedquery

@NamedQuery(name = "CoverholderAgreement.all",
query = "SELECT c FROM CoverholderAgreement c",
hints = {
@QueryHint(name = QueryHints. QUERY_RESULTS_CACHE, value=HintValues.TRUE)
})

which speed up my code significantly... (so far so good)

in some part of the application I add and delete objects... doing that, the namedquery cache is not automatically refreshed so I need to refresh it by hand at every occation that I modify the DB:

Quote:
> utx.commit();
> ((JpaEntityManager)em.getDelegate()).getServerSession().getIdentityMapAccessor().clearQueryCache("CoverholderAgreement.all");


I do not like this option as it leads to generate new bugs... think about the case when I persist another object which by CASCADING persists a new CoverholderAgreement and I forget to refresh the namedquery cache... (this things hapends specially after some time or when future developers maintain the code and they are not aware of some cached namedquery)...

so just wondering if there is a better way for doing it ????

thanks !
Previous Topic:(no subject)
Next Topic:(no subject)
Goto Forum:
  


Current Time: Tue Nov 25 22:18:38 GMT 2014

Powered by FUDForum. Page generated in 0.02135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software