openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter (JIRA)" <>
Subject [jira] Created: (OPENJPA-396) Cloning Calendar proxies doesn't detach from StateManager
Date Mon, 08 Oct 2007 14:14:50 GMT
Cloning Calendar proxies doesn't detach from StateManager

                 Key: OPENJPA-396
             Project: OpenJPA
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.0.0, 1.0.1, 1.1.0
            Reporter: Kevin Sutter
            Assignee: Kevin Sutter
             Fix For: 1.0.1, 1.1.0

This problem was first discussed on our dev mailing list:

Per the discussion on that thread, I am proposing to modify the generated proxy code to override
the clone() method.  This clone() method will do the necessary copying of data from the original
object, but then also null out the sm (StateManager) and zero out the field attributes.  This
action detaches the cloned object from the StateManager (and associated EntityManager).

Instead of limiting this action to the Calendar proxy, I am adding the clone() method implementation
to all of our proxy objects that we generate.  Granted, some of the object types do not directly
support the clone() method, but that will be detected when or if anybody attempts to use the
clone() method on these types (compiler generated error message).

I'll be posting a patch shortly and I plan to commit the changes later today (unless there
is opposition).


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

View raw message