Hi Matt, Thanks for the info - I was heading in the right direction.
It seems that my bean (A) contains the following refs: A->B->C A->D->E->C Is that cyclic? It has these in both scenarios (exception thrown/not thrown). Any suggestions why this might only cause me problems in certain situations? Thanks in advance. Mike ----- Original Message ----- From: "Hope, Matthew" <[EMAIL PROTECTED]> To: "'Jakarta Commons Users List'" <[EMAIL PROTECTED]> Sent: Thursday, September 18, 2003 5:15 PM Subject: RE: Betwixt - CyclicReferenceException A cyclical reference is when a loop exists in your object graph (or indeed any type of graph) If you have A- > B B -> C C -> A Then a loop exists and if some algorithm is meant to 'walk' through the graph and do something at each node (object) then in the situation above it would walk forever going round in a loop. Graph traversal (walk) algorithms often include mechanisms to avoid loops, either by terminating in a failure state (throw an exception) or by not traversing an edge to a node already visited. This implementation is maintaining a set of nodes visited and when a node is revisited it throws an exception. One area where this can be a pain is if you have a structure A -> B via variable x A -> B via variable y In this case a na�ve algorithm will call this a revisit - I don't know if betwixt does though Your two examples would contain one which has no such loop and another which does. Perhaps in one you are reusing an object in two different variables? Matt -----Original Message----- From: Michael Watson [mailto:[EMAIL PROTECTED] Sent: 18 September 2003 16:58 To: Jakarta Commons Users List Subject: Betwixt - CyclicReferenceException Hi, I'm having issues with cyclic references and was wondering if anyone can shed some light for me. I'm calling BeanWriter.write (on a reasonably complex bean) and occasionally getting a cyclicreferenceexception thrown. I can reproduce the problem easily but the thing that's confusing me is that I can call this method with another instance of the same type of bean (with near identical data) and it doesn't throw an exception. Can anyone explain exactly what a cyclic reference is, how I might be able to identify what part of the bean is causing it and how I can try and avoid it? Thanks in advance. Mike --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ************************************************************************** The information transmitted herewith is sensitive information intended only for use by the individual or entity to which it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
