[ 
https://issues.apache.org/jira/browse/OPENJPA-1097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842679#action_12842679
 ] 

Donald Woods commented on OPENJPA-1097:
---------------------------------------

Basically, the patch fixed the clear() behavior, in that JavaType.OBJECT fields 
were not being unproxied and added junits to verify the following behavior by 
using an Entity20 class that contains the following fields -
    @Temporal(TemporalType.DATE) java.sql.Date
    @Temporal(TemporalType.TIME) java.sql.Time
    @Temporal(TemporalType.TIMESTAMP) java.sql.Timestamp

For trunk (when using the 2.0 default compatibility settings and the new JPA 
2.0 Spec required in-place detach and no return values, which differs from the 
OpenJPA 1.x value-added detach()/detachAll() methods):
1) find() - entity uses the proxied classes before and after serialization
2) after in-place detach() - entity does NOT use proxied classes before or 
after serialization
3) after in-place detachAll() - none of the entities use proxied classes before 
or after serialization
4) detachCopy() - returns an entity that does NOT use proxied classes before or 
after serialization
5) clear() - existing entity instances after EM.clear() do NOT use proxied 
classes before or after serialization

For 1.3.x (same for proposed 1.2.x changes):
1) find() - entity uses the proxied classes before and after serialization
2) detach() returns a copy of the original entity that does NOT use proxied 
classes before or after serialization, but the original entity instance still 
uses proxies and returns FALSE for isDetached()
3) detachAll() returns copies of the original entities that do NOT use proxied 
classes before or after serialization, but the original entity instances still 
use proxies and returns FALSE for isDetached()
4) there is no tests for detachCopy() as this was added in 2.0.0 because JPA 
2.0 Spec required in-place detach() and no return value
5) clear() - existing entity instances after EM.clear() do NOT use proxied 
classes before or after serialization


> Detachment processing of our proxied mutable types (Date, Timestamp, etc) 
> needs to be consistent
> ------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1097
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1097
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.2.2, 1.3.0, 2.0.0-M1
>            Reporter: Kevin Sutter
>            Assignee: Donald Woods
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: OPENJPA-1097-12x.diff, OPENJPA-1097-13x.diff, 
> OPENJPA-1097-tests.diff, OPENJPA-1097-trunk.diff, OPENJPA-1097.patch
>
>
> Per the discussion on our forums [1], there seems to some consistent issues 
> with how we perform detachment processing of the mutable types such as Date, 
> Timestamp, etc.  There seems to be a couple of issues (at least)...
> o  Detachment processing is not consistent between the detach() method and 
> the clear() method.
> o  Tracking of changes on a detached entity, but still allow it to be 
> serialized without requiring the openjpa jar file.
> [1]  http://n2.nabble.com/Date-Problem-td2943310.html#a2943310

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to