[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [eclipselink-users] ChangeTracking not working when Object is Created
|
- From: James Sutherland <jamesssss@xxxxxxxxx>
- Date: Wed, 19 Aug 2009 07:18:43 -0700 (PDT)
- Delivered-to: eclipselink-users@eclipse.org
What do you mean by does not work? Are you getting an error, or missing
updates?
The listener will be null for any new objects, only existing objects (read
from the database) will have a listener. (changes to new objects do not need
to be tracked, as they are new, so always changed).
nishitv02 wrote:
>
> ChangeTracking does not work when an object is created from the database
> and we use the same object pointer to update.
>
> AttributeChangeListener myListener = (AttributeChangeListener)
> ((ChangeTracker) myObject)
> ._persistence_getPropertyChangeListener();
>
> Weaving of myObject is happening fine as myObject can be casted to
> changeTracker.
> But myListener is null.
>
> T retVal= (T)getJpaTemplate().execute(new JpaCallback() {
> public Object doInJpa(EntityManager em)
> throws PersistenceException {
> em.persist(t);
> ..........
> return t;
> }
> }
>
> Is it also the case that For change tracking to work an object needs to be
> committed to the database ?
>
-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/ChangeTracking-not-working-when-Object-is-Created-tp24800300p25045036.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.