Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Alert that DCN Took Place(Can I be notified that a DCN was handled by Eclipse Link JPA?)
Alert that DCN Took Place [message #1007457] Tue, 05 February 2013 17:20 Go to next message
Julie Schenk is currently offline Julie Schenk
Messages: 18
Registered: August 2012
Junior Member
I'm looking for some way to be notified of the Database Change Notification update outright in addition to knowing that when I query [again] I will get updated information from the cache object/db. In my case, I have a GUI to update when a change occurs to the DB.

I started following along the basic DCN example from (http://docs.oracle.com/cd/E14072_01/java.112/e10589/dbchgnf.htm)

dcr = oc.registerDatabaseChangeNotification(prop);
DatabaseChangeNotificationListener list =
new DatabaseChangeNotificationListener();
dcr.addListener(list);

but after using scripts to create my tables I don't get anything back from the following:

String[] tableNames = dcr.getTables();

In the basic example of course EclipseLink JPA isn't use- just a regular statement to "register" the table.

So is there something to which I can listen to know that there's been a change so that I know to update my GUI pages that have the same Oracle DB backend? My objects are all persistent objects. I updated persentence.xml just like suggested here:
http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN. And I verified that the example runs with my environment.

Hope that makes some sense.

Thanks!

How do I get a hold of the OracleChangeNotificationListener directly? Or, can I be notified that the cache has been invalidated?

[Updated on: Wed, 06 February 2013 11:21]

Report message to a moderator

Re: Alert that DCN Took Place [message #1008075 is a reply to message #1007457] Fri, 08 February 2013 13:26 Go to previous message
Julie Schenk is currently offline Julie Schenk
Messages: 18
Registered: August 2012
Junior Member
I went ahead and registered my tables in the same manner as the basic DCN example does and it seems to work just fine. I open two instances of my application, add an item to the DB via one of my GUI lists, and the listener in the other GUI prints out a message. Fantastic.

Does anyone see any complications that I don't w.r.t. the existing Eclipse Link DCN registration(s)?

Also, if there's a more graceful and/or streamline way to be going about this I'd love to know.

Thanks.
Previous Topic:Retrieving data from a resultset with two or more same column names.
Next Topic:JPA caching
Goto Forum:
  


Current Time: Fri Aug 01 18:44:49 EDT 2014

Powered by FUDForum. Page generated in 0.09251 seconds