OpenJPA
  1. OpenJPA
  2. OPENJPA-396

Cloning Calendar proxies doesn't detach from StateManager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0, 1.0.1, 1.1.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: kernel
    • Labels:
      None

      Description

      This problem was first discussed on our dev mailing list: http://www.nabble.com/Cloning-Calendar-proxies-tf4571181.html

      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).

      Thanks,
      Kevin

        Activity

        Donald Woods made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Kevin Sutter made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Kevin Sutter made changes -
        Field Original Value New Value
        Attachment OPENJPA-396.patch [ 12367265 ]
        Kevin Sutter created issue -

          People

          • Assignee:
            Kevin Sutter
            Reporter:
            Kevin Sutter
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development