On 5/22/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
I'm
currently having an object in my temporary data context with
relationships to objects in my session-scoped data context. That's
not normal, is it? This particular problem might be caused by how I
was doing my serialization of DataObjects in the session-scoped data
context (that context is not serialized, only the objects are).
Yeah, it's looking like this one was a self-inflicted problem.
I threw in some extra code in my base DataObject:
private void writeObject(java.io.ObjectOutputStream out)
throws IOException
{
out.writeBoolean(Boolean.TRUE ==
this.getDataContext().getUserProperty("temporary"));
out.defaultWriteObject();
}
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException
{
boolean isInTemporaryDataContext = in.readBoolean();
in.defaultReadObject();
this.isInTemporaryDataContext = isInTemporaryDataContext;
}
and then conditionally attach to the thread-bound datacontext only if
isInTemporaryDataContext is false, and that appears to have solved
this problem.