double record in history [message #653675] |
Thu, 10 February 2011 11:16  |
Eclipse User |
|
|
|
I have a N-M "article2storage" table holding the two keys of the relationship (article and storage). When in the article or storage management Swing window this relaltion is removed, the article2storage entity is removed from the collection AND the article or storage reference is cleared.
So, for example, in the article screen, when the article2storage relation needs to be deleted, article2storage.article is set to null.
Then the entity is merged and deleted when the save button is pressed.
This is what is written to the table:
oidnr articlenr storagenr lazylock dwhmodified dwhby hstvalidfrom hstvaliduntil
372266 82 37111 1 2011-02-10 17:02:49 69 2011-02-10 17:02:49 2011-02-10 17:02:59
372266 (null) 37111 2 2011-02-10 17:02:57 69 2011-02-10 17:02:59 2011-02-10 17:02:59
The relation was between article 82 and storage 37111. It was created 17:02:49 and deleted 17:02:59. Then a record is added where the articlenr is set to null. Any idea why?
I"m using EclipseLink 2.0.2
Tom
|
|
|
|
|
|
|
|
|
|
Re: double record in history [message #654927 is a reply to message #654874] |
Thu, 17 February 2011 11:16  |
Eclipse User |
|
|
|
In general EclipseLink updates objects that will be deleted if they are changed, as the update may be desired by the user and required to resolve constraints.
If you don't want the update, the best solution is to not update your object.
EclipseLink does have an option to performDeletesFirst which you could enable, this will avoid the update, but could lead to deletion constraint issues.
You could also refresh or revert the object before removing it.
In general the update should not cause any issues, so you could just ignore it as well.
|
|
|
Powered by
FUDForum. Page generated in 0.04722 seconds