openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dianne Richards (JIRA)" <>
Subject [jira] Commented: (OPENJPA-885) Support clear methods on EntityManager, including new CascadeType.CLEAR
Date Fri, 27 Feb 2009 01:24:01 GMT


Dianne Richards commented on OPENJPA-885:

The clear(Object) method will use an existing Broker detach method. There are several differences
in behavior between those required for the clear method and the current detach method. As
a result, the default 2.0 behavior will change. However,  compatibility options will be provided
to revert to the 1.x behaviors.

The first difference has to do with flush. The current behavior is to flush before detaching.
However, the JPA 2.0 spec specifically says that the current data will not be persisted. So,
this will be the default. The using application can use the Compatibility setFlushBeforeDetach()
method to change this behavior.

With the current detach methods, copies are made of the entities and returned. Does anybody
know why this copy is made? It's not necessary for the new clear method since it has a void
return. We'd like to change the default behavior for the current detach methods to return
the original enties with a state change. Does anybody know of any impacts this might have?
Again, there will be a compatibility option to change this in special circumstances.

With the current detach methods, the entities still remain in the persistent context. However,
for the new clear method, the specified entities must be removed. I assume the impact will
be in performance. As with the previous 2 differences, a compatibility option will be provided.

The last difference deals with cascading. The current detach behavior does a complete cascade.
The clear method requires the cascade to be explicitely specified. Does anyone see a need
for providing a compatibility option for this also?

> Support clear methods on EntityManager, including new CascadeType.CLEAR 
> ------------------------------------------------------------------------
>                 Key: OPENJPA-885
>                 URL:
>             Project: OpenJPA
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.0.0
>         Attachments: patch.txt
> Support the 2.0 new  EntityManager clear() methods. Also support the new CascadeType.CLEAR.

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

View raw message