<mailto:
christopher.delahunt@oracle.com>> wrote:
I am not sure exactly what you mean, so I'll start by make a general
warning; Performing a refresh when there are changes can be risky,
as it essentially resets the refreshed entity to what it is in the
database. Any changes you make that are not in the database might
be lost. And as cascade refresh/all seem to be overused, performing
a refresh over an object tree can cause unintentionally wiping out
changes to the tree. Please note that refresh also resets lazy
relationships, so that if you have A->B lazy relation marked cascade
refresh and refresh A, then later on find and make changes to B in
the same context, these changes might be wiped out when you access
That said, what you are experience sounds like if you are updating
you should flush the change before you issue a query that might
cause a refresh. Calling flush pushes the changes to the database
so that they are picked up when the refresh occurs.
Best Regards,
Chris
On 18/09/2012 3:32 PM, vaidya nathan wrote:
Hi Eclipselink users,
We are using eclipselink 2.4.0 and having a problem that is
mystifying.
We are using jboss as our container , and spring jta to write
data and
so far so good. While testing we found that whenever we make a
change to
the database directly the data is not getting refreshed
automatically
(The eclipselink cache is not getting refreshed automatically).
So we
introduced a hint something like
Query jpaq = JpaHelper.createQuery(query, getEntityManager()) ;