Cayenne
  1. Cayenne
  2. CAY-553

Top-level DataContext fails to attach to default DataDomain transparently on deserialization

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2 branch
    • Fix Version/s: None
    • Component/s: Core Library
    • Labels:
      None

      Description

      Top-level DataContext fails to attach to default DataDomain transparently on deserialization.

      Caused by: org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2B2
      April 17 2006] Cannot commit changes - channel is not set.
      at org.objectstyle.cayenne.access.DataContext.flushToParent(DataContext.java:1186)
      at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1121)

      Data context is created with:

      DataContext.getThreadDataContext().createDataContext()

      Data context is serialized with:

      private void writeObject(java.io.ObjectOutputStream out) throws IOException

      { out.writeObject(this.childDataContext); }

      Data context is deserialized with:

      private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException

      { this.childDataContext = (DataContext)in.readObject(); // childDataContext.setChannel(super.threadDataContext().getParentDataDomain()); }

      Problem goes away if setChannel line is uncommented.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mike Kienenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development