Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-553

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.2 branch
    • None
    • Core Library
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mkienenb Mike Kienenberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: