DeepCopy problems with dissolved proxy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top