H
horst
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
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