Menu

Stack overflow

Help
mantesat
2007-03-01
2013-04-25
  • mantesat

    mantesat - 2007-03-01

    Hi there! I'm trying to use beanlib to duplicate some hibernate objects. Most of the relations between these objects are many-to many. However, when I try to perform a deep copy (or a simple copy), and send these objects to the client, the browser (IE7) pops up a stack overflow error. This does not happen if shallow copy is used. Could this be because of the many-many relations, which cause recursive object replications?

    Thanks in advance
    A.Mantes

     
    • Joe D. Velopar

      Joe D. Velopar - 2007-03-01

      Recursive object replications should have no problem (ie be handled properly) in that the same object instance that has been cloned previously will be mapped to the same clone instead of being replicated again.

      Is it possible to provide a test case where the problem can be replicated, so I can investigate further ?

       
    • Joe D. Velopar

      Joe D. Velopar - 2007-03-01

      Also, which version of beanlib are you using ?

       
    • Joe D. Velopar

      Joe D. Velopar - 2007-03-01

      On 2nd read, are you saying the deep clone by Beanlib was succesful, but you got a stack overflow problem when the cloned object is sent to IE ?  Probably the size of the object was too large for the browser, but it sounds like it has nothing to do with Beanlib!

       
    • mantesat

      mantesat - 2007-03-02

      Maybe you're right, although my objects are relatively small. Could this be caused from not properly closed sessions on hibernate, causing objects cloned with beanlib to be somewhat "corrupt" and causing problems when sent to IE? I'll do some more tests, and see if I can figure out the exact cause for this.

       
    • Joe D. Velopar

      Joe D. Velopar - 2007-03-02

      Note the resultant objects from Beanlib are pure data transfer objects that have nothing to do with Hibernate sessions.

       
    • mantesat

      mantesat - 2007-03-03

      Well after some tests, I'm almost positive that the problem comes from trying to replicate objects that are inside a list. If deepCopy or copy is used, and I try to copy each one of the objects of the list seperately, a stack overflow popup is thrown when sent to the client. However, if I replicate the entire list (using copy or deepcopy) to a new list, everything is ok. Is this normal?

       
      • Joe D. Velopar

        Joe D. Velopar - 2007-03-03

        If the object graphs of the objects in the list have lots references to each other, copying each of the objects individually would result in more memory requirement than copying the entire list. 

        For example, say the list contains object A and B, both reference the same object C internally.  If the list is deeply cloned, it will result in a list that contains object A1 and B1, both references the same cloned object C1 internally.  However, if A and B are individually cloned, you get A1-C1, and B1-C2.

         

Log in to post a comment.