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