You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Mike Kienenberger (JIRA)" <ji...@apache.org> on 2006/05/23 03:12:07 UTC

[JIRA] Created: (CAY-553) Top-level DataContext fails to attach to default DataDomain transparently on deserialization

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

         Key: CAY-553
         URL: http://issues.apache.org/cayenne/browse/CAY-553
     Project: Cayenne
        Type: Bug

  Components: Cayenne Core Library  
    Versions: 1.2 [BETA]    
    Reporter: Mike Kienenberger


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.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/cayenne/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira