DeepCopy problems with dissolved proxy

Discussion in 'Java' started by horst, Jan 16, 2007.

  1. horst

    horst Guest

    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
     
    horst, Jan 16, 2007
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vidy5300
    Replies:
    0
    Views:
    1,082
    vidy5300
    Jun 7, 2004
  2. Replies:
    0
    Views:
    1,773
  3. Karsten Wutzke
    Replies:
    1
    Views:
    1,067
    Steven Simpson
    Aug 20, 2007
  4. Klein Stéphane
    Replies:
    3
    Views:
    780
    Steve Holden
    Dec 20, 2009
  5. Alejandro Molina

    Proxy and non Proxy configurations

    Alejandro Molina, Jul 15, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    292
    Alejandro Molina
    Jul 15, 2004
  6. Yu Chai

    winsock proxy vs proxy in IE

    Yu Chai, Jun 22, 2005, in forum: ASP General
    Replies:
    1
    Views:
    191
    linux par
    Apr 2, 2006
  7. Greg
    Replies:
    4
    Views:
    522
    Steven Simpson
    Aug 16, 2012
  8. Greg
    Replies:
    1
    Views:
    320
    Steven Simpson
    Aug 17, 2012
Loading...