Issue Details (XML | Word | Printable)

Key: OPENJPA-591
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Michael Dick
Reporter: Michael Dick
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenJPA
OPENJPA-119

Entities are flushed before being detached or serialized

Created: 05/May/08 08:41 PM   Updated: 28/May/08 07:25 PM
Return to search
Component/s: kernel
Affects Version/s: 1.0.0, 1.0.1, 1.0.2
Fix Version/s: 1.0.3, 1.1.1, 1.2.0

Time Tracking:
Not Specified

Resolution Date: 28/May/08 07:25 PM


 Description  « Hide
Entities are flushed if the entity is serialized or if the detach and detachAll methods are invoked.

Similar to OPENJPA-119 I believe this is a remnant of the JDO persistence layer. Whether this is desirable in JPA or not, we need to be consistent whether the entity is detached via clear, or the detach methods.

To resolve the problem I propose adding a new Compatibility option : flushBeforeDetach. If this is set to true we'll keep the current JDO-like behavior. If false then we'll just detach. I believe the same setting could apply when entities are serialized although it might be clearer to have a separate option for serialization.

In the 1.0.x branch the flushBeforeDetach setting will only take effect for the detach, detachAll and serialization path. It will not affect the EntityManager.clear() method - in order to maintain backwards compatibility.

In 1.2.x + the clear method will also defer to the flushBeforeDetach setting.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Patrick Linskey added a comment - 12/May/08 06:51 PM
Why is this still listed as open?

Michael Dick added a comment - 28/May/08 07:25 PM
Sorry Patrick, I didn't notice your update until now. The changes currently do not affect the EntityManager.clear() method contrary to my earlier remarks in the issue.

For now I'm going to close the issue, if we need to link em.clear with em.detach then we can open a sub task.