Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA/DCN - working for INSERT; trouble with UPDATE(Not getting updated record when DCN received after update in DB)
JPA/DCN - working for INSERT; trouble with UPDATE [message #1028088] Wed, 27 March 2013 20:27 Go to next message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
I have the JPA/DCN set up and working in my application. Any time there is a change in the Oracle 11g DB, my application receives a notification and fires a property change event, sending the table name in the "new value" argument.

When I attempt to re-read the values from the table upon receiving the property change notification, I always get a new record if there was an INSERT performed however I do NOT get an updated record if there was an UPDATE performed.

S, I receive the change notification from the DB but it seems like the cache isn't invalidated for the update like it is for the insert.

Do I have to do something special to make that work? It seems like it works in the JPA/DCN example: http://wiki.eclipse.org/EclipseLink/Examples/JPA/DCN
Re: JPA/DCN - working for INSERT; trouble with UPDATE [message #1028754 is a reply to message #1028088] Thu, 28 March 2013 17:40 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1039
Registered: July 2009
Senior Member
How are you reading the existing updated entities? Be sure you are either getting a new EntityManager or clearing it occasionally, as the managed entities it references are meant to operate like a transaction - once read in, they are cached by the EM and will not see external changes.
Re: JPA/DCN - working for INSERT; trouble with UPDATE [message #1032256 is a reply to message #1028754] Tue, 02 April 2013 19:28 Go to previous message
Julie Schenk is currently offline Julie SchenkFriend
Messages: 18
Registered: August 2012
Junior Member
Thank you. I had not been doing either. I now retrieve a new EntityManager when the DCN is due to an UPDATE operation and so far it seems to be working.

Really appreciate the reply.
Previous Topic:Inheritance and TYPE
Next Topic:Commit object with ID
Goto Forum:
  


Current Time: Thu Dec 18 18:33:30 GMT 2014

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

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