Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
What do you mean when you say that you 'apply a local fix' - how is what you describe a 'fix' for anything? (You still end up with the cycles in the database, which I gather you want to do)

I mean I fix the code so it doesn't die() or loop forever anymore. A typical break is either an error about not being about the find the object linked to, or worse, an infinite loop loading the same nodes over and over.

The cycles are perfectly valid, so I'm not trying to weed them out.

Why would you be creating the id for A 'early' when you would normally generate the ids in order?

Here's the "normal" course of events in my system:

  • Create an object, unsaved without an ID.
  • Fill it with data. Some of the data may include the IDs of linked objects.
  • Save the object, creating an ID for it.

That works great until the code finds a cycle. When I run into a cycle I fix it to:

  • Create an object, unsaved without an ID.
  • Fill it with data, but not the data that might cycle.
  • Save the partially filled object, creating an ID for it.
  • Fill in the possibly cyclic pieces.
  • Save the completed object.

The problem is that doing this for each node type when I find a break is a real pain.


In reply to Re^2: In search of an algorithm for loading cyclic graphs by samtregar
in thread In search of an algorithm for loading cyclic graphs by samtregar

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2023-02-04 02:14 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (30 votes). Check out past polls.