[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [eclipselink-users] Notifications about external database changes
|
A fast implementation compatible with caching is that your DB send to
your application a JMS invalidation message containing the table name +
PK modified, likely implemented using triggers. In Oracle DB, it's
relatively easy, because already supporting JMS. Then your application
can match entities by using the table name received.
This way you just have a small window of stale data, which you can
protect using optimistic locking.
-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Philipp
Kursawe
Sent: Monday, June 08, 2009 4:14 PM
To: eclipselink-users@xxxxxxxxxxx
Subject: [eclipselink-users] Notifications about external database
changes
Hello,
I am having a little trouble understanding how my EntityManager could be
informed about changes to the database that were made by a 3rd Party
program in another process. Is there any recommended way to
reload/refresh
the entities in the entity manager? I am currently using
"eclipselink.refresh=true" as a query hint in my getResultList() calls.
But once you forget that, you will not see external changes. Is there a
way to globally turn of entity caching?
Also is there a "non-pull" way of getting notified about changes in
tables
from outside? My application needs to monitor progress on orders and
currently I am polling every 10 seconds to do a full entity update using
a
"select e from SendOrder e" query. Which is of course highly
inefficient.
I could use DB-triggers but they cannot be managed by JPA and are not
available on every database.
Any ideas?
Thanks,
Phil
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users