Home » Eclipse Projects » EclipseLink » Strange behaviour if weaving is enabled
Strange behaviour if weaving is enabled [message #1067328] |
Mon, 08 July 2013 06:20  |
Eclipse User |
|
|
|
Hi,
i have a weird behaviour with embedded-objects in a SE-Environment, if weaving is enabled.
I use a contact entity which contains several embedded objects, e.g. adress, zipcode and some meta-information (RecordMetaData which extends RecordMetaData_Basic).
Setting the meta information before a persist (c = Contact-Entity) does nothing if weaving ist enabled:
c.getMetaInformation().setCreatedBy("Technical User");
c.getMetaInformation().setCreated(new Timestamp(new Date().getTime()));
Results in:
[EL Fine]: sql: 2013-07-08 11:43:41.313--ClientSession(33223668)--Connection(3042406)--Thread(Thread[main,5,main])--INSERT INTO Contact (ID, CONTACTNAME, CITY, STATECODE, STREET, CODENUMBER, CHANGED, CHANGEDBY, CREATED, CREATEDBY) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [8001, Java Duke, USA, SomeCode, 2nd Ave, 12345, null, null, null, null]
Only the merge for the first inheritance of the meta information is applied to the db:
found.getMetaInformation().setChanged(new Timestamp(new Date().getTime()));
found.getMetaInformation().setChangedBy("Another Technical User");
Results in:
[EL Fine]: sql: 2013-07-08 11:44:17.171--ClientSession(33223668)--Connection(3042406)--Thread(Thread[main,5,main])--UPDATE Contact SET CHANGED = ? WHERE (ID = ?)
bind => [2013-07-08 11:44:15.172, 8001]
==================================================
If weaving is disabled, all attributes are purged in the db:
[EL Fine]: sql: 2013-07-08 12:09:58.14--ClientSession(14215426)--Connection(15483616)--Thread(Thread[main,5,main])--INSERT INTO Contact (ID, CONTACTNAME, CITY, STATECODE, STREET, CODENUMBER, CHANGED, CHANGEDBY, CREATED, CREATEDBY) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
bind => [9001, Java Duke, USA, SomeCode, 2nd Ave, 12345, null, null, 2013-07-08 12:09:58.046, Technical User]
[EL Fine]: sql: 2013-07-08 12:10:17.666--ClientSession(14215426)--Connection(15483616)--Thread(Thread[main,5,main])--UPDATE Contact SET CHANGED = ?, CHANGEDBY = ? WHERE (ID = ?)
bind => [2013-07-08 12:10:16.199, Another Technical User, 9001]
==================================================
Why does this happen?
I use Eclipse Persistence Services - 2.4.1.v20121003-ad44345
A testcase is attached.
Cheers,
Reiner
|
|
| | |
Goto Forum:
Current Time: Wed Jul 23 03:41:16 EDT 2025
Powered by FUDForum. Page generated in 3.51251 seconds
|